Format Java code to ONAP standard
[aai/search-data-service.git] / src / test / java / org / onap / aai / sa / searchdbabstraction / searchapi / DateHistogramAggregationTest.java
index 8ce41f9..005cb76 100644 (file)
@@ -2,8 +2,8 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017 Amdocs
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2018 Amdocs
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * ============LICENSE_END=========================================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 package org.onap.aai.sa.searchdbabstraction.searchapi;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.Test;
-import org.onap.aai.sa.searchdbabstraction.searchapi.DateHistogramAggregation;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
+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());
+        }
     }
-  }
 
 }