X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Faai%2Fsa%2Fsearchdbabstraction%2Fsearchapi%2FDateHistogramAggregationTest.java;h=005cb7641d753460ae5040884a3f70b230843c02;hb=15af66b115f3e8046b2d0f2634fb77b3d835f730;hp=6a3ecf7816eb2b5c9c0f7a2b7dc1d833ffcad6a2;hpb=71393bb2bf9fb10962723e61cf0e70d9aa202645;p=aai%2Fsearch-data-service.git diff --git a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregationTest.java b/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregationTest.java index 6a3ecf7..005cb76 100644 --- a/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregationTest.java +++ b/src/test/java/org/onap/aai/sa/searchdbabstraction/searchapi/DateHistogramAggregationTest.java @@ -27,57 +27,52 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Test; public class DateHistogramAggregationTest { - ObjectMapper mapper = new ObjectMapper(); + ObjectMapper mapper = new ObjectMapper(); - @Test - public void testFullSet() { - String input = - "{\r\n \"field\": \"mydate\",\r\n \"interval\": \"day\",\r\n \"time-zone\": \"-01:00\"\r\n}"; + @Test + public void testFullSet() { + String input = "{\r\n \"field\": \"mydate\",\r\n \"interval\": \"day\",\r\n \"time-zone\": \"-01:00\"\r\n}"; - String expected = - "\"date_histogram\": {\"field\": \"mydate\", \"interval\": \"day\", \"time_zone\": \"-01:00\"}"; + String expected = + "\"date_histogram\": {\"field\": \"mydate\", \"interval\": \"day\", \"time_zone\": \"-01:00\"}"; - DateHistogramAggregation actual; - try { - actual = mapper.readValue(input, DateHistogramAggregation.class); - assertEquals(expected, actual.toElasticSearch()); - } catch (Exception e) { - fail("Exception occurred: " + e.getMessage()); + DateHistogramAggregation actual; + try { + actual = mapper.readValue(input, DateHistogramAggregation.class); + assertEquals(expected, actual.toElasticSearch()); + } catch (Exception e) { + fail("Exception occurred: " + e.getMessage()); + } } - } - @Test - public void test2() { - String input = - "{\r\n \"field\": \"mydate\",\r\n \"interval\": \"day\"\r\n}"; + @Test + public void test2() { + String input = "{\r\n \"field\": \"mydate\",\r\n \"interval\": \"day\"\r\n}"; - String expected = - "\"date_histogram\": {\"field\": \"mydate\", \"interval\": \"day\"}"; + String expected = "\"date_histogram\": {\"field\": \"mydate\", \"interval\": \"day\"}"; - DateHistogramAggregation actual; - try { - actual = mapper.readValue(input, DateHistogramAggregation.class); - assertEquals(expected, actual.toElasticSearch()); - } catch (Exception e) { - fail("Exception occurred: " + e.getMessage()); + DateHistogramAggregation actual; + try { + actual = mapper.readValue(input, DateHistogramAggregation.class); + assertEquals(expected, actual.toElasticSearch()); + } catch (Exception e) { + fail("Exception occurred: " + e.getMessage()); + } } - } - @Test - public void test3() { - String input = - "{\r\n \"field\": \"mydate\"\r\n}"; + @Test + public void test3() { + String input = "{\r\n \"field\": \"mydate\"\r\n}"; - String expected = - "\"date_histogram\": {\"field\": \"mydate\"}"; + String expected = "\"date_histogram\": {\"field\": \"mydate\"}"; - DateHistogramAggregation actual; - try { - actual = mapper.readValue(input, DateHistogramAggregation.class); - assertEquals(expected, actual.toElasticSearch()); - } catch (Exception e) { - fail("Exception occurred: " + e.getMessage()); + DateHistogramAggregation actual; + try { + actual = mapper.readValue(input, DateHistogramAggregation.class); + assertEquals(expected, actual.toElasticSearch()); + } catch (Exception e) { + fail("Exception occurred: " + e.getMessage()); + } } - } }