Fix simple Sonar Lint issues
[aai/search-data-service.git] / src / test / java / org / onap / aai / sa / rest / DocumentTest.java
index 9fa5fe1..d16fe87 100644 (file)
@@ -103,6 +103,7 @@ public class DocumentTest {
         Assert.assertTrue(HttpStatus.BAD_REQUEST.value() == response.getStatusCodeValue());\r
     }\r
 \r
+    @SuppressWarnings("unchecked")\r
     @Test\r
     public void testProcessPost_NotNullContent() throws Exception {\r
         String transactionId = "transactionId-1";\r
@@ -117,7 +118,7 @@ public class DocumentTest {
         Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),\r
                 Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))\r
                 .thenThrow(IllegalArgumentException.class);\r
-        ResponseEntity response =\r
+        ResponseEntity<?> response =\r
                 documentApi.processPost(content, request, headers, httpResponse, "index", documentStore);\r
         Assert.assertNotNull(response);\r
         Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());\r
@@ -179,7 +180,7 @@ public class DocumentTest {
 \r
     }\r
 \r
-    //\r
+    @SuppressWarnings("unchecked")\r
     @Test\r
     public void testProcessSearchWithGet_ValidateThrowsException() throws Exception {\r
         String transactionId = "transactionId-1";\r
@@ -207,7 +208,6 @@ public class DocumentTest {
 \r
     }\r
 \r
-    //\r
     @Test\r
     public void testProcessSearchWithGet_ValidateIsFalse() throws Exception {\r
         String transactionId = "transactionId-1";\r
@@ -279,6 +279,7 @@ public class DocumentTest {
         Assert.assertTrue(HttpStatus.BAD_REQUEST.value() == response.getStatusCodeValue());\r
     }\r
 \r
+    @SuppressWarnings("unchecked")\r
     @Test\r
     public void testProcessPut_RequestThrowsException() throws Exception {\r
         String transactionId = "transactionId-1";\r
@@ -319,7 +320,6 @@ public class DocumentTest {
         Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());\r
     }\r
 \r
-    @Ignore\r
     @Test\r
     public void testProcessPut_ResultInvalid() throws Exception {\r
         String transactionId = "transactionId-1";\r
@@ -338,7 +338,7 @@ public class DocumentTest {
         Mockito.when(searchServiceApi.validateRequest(Mockito.any(HttpHeaders.class),\r
                 Mockito.any(HttpServletRequest.class), Mockito.any(ApiUtils.Action.class), Mockito.anyString()))\r
                 .thenReturn(true);\r
-        Mockito.when(documentStore.updateDocument(Mockito.anyString(), Mockito.any(DocumentStoreDataEntity.class),\r
+        Mockito.when(documentStore.createDocument(Mockito.anyString(), Mockito.any(DocumentStoreDataEntity.class),\r
                 Mockito.anyBoolean())).thenReturn(result);\r
         ResponseEntity<String> response =\r
                 documentApi.processPut(content, request, headers, httpResponse, "index", "id-1", documentStore);\r
@@ -346,6 +346,7 @@ public class DocumentTest {
         Assert.assertTrue(HttpStatus.FOUND.value() == response.getStatusCodeValue());\r
     }\r
 \r
+    @SuppressWarnings("unchecked")\r
     @Test\r
     public void testProcessDelete_RequestThrowsException() throws Exception {\r
         String transactionId = "transactionId-1";\r
@@ -413,6 +414,7 @@ public class DocumentTest {
         Assert.assertTrue(HttpStatus.FOUND.value() == response.getStatusCodeValue());\r
     }\r
 \r
+    @SuppressWarnings("unchecked")\r
     @Test\r
     public void testProcessGet_RequestThrowsException() throws Exception {\r
         String transactionId = "transactionId-1";\r
@@ -496,6 +498,7 @@ public class DocumentTest {
         Assert.assertTrue(HttpStatus.BAD_REQUEST.value() == response.getStatusCodeValue());\r
     }\r
 \r
+    @SuppressWarnings("unchecked")\r
     @Test\r
     public void testQueryWithGetWithPayload_RequestThrowsException() throws Exception {\r
         String transactionId = "transactionId-1";\r
@@ -555,6 +558,7 @@ public class DocumentTest {
         Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());\r
     }\r
 \r
+    @SuppressWarnings("unchecked")\r
     @Test\r
     public void testCreateProcessIndex_IndexApi_RequestThrowsException() throws Exception {\r
         String transactionId = "transactionId-1";\r
@@ -612,6 +616,7 @@ public class DocumentTest {
         Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());\r
     }\r
 \r
+    @SuppressWarnings("unchecked")\r
     @Test\r
     public void testProcessDelete_IndexApi_RequestThrowsException() throws Exception {\r
         String transactionId = "transactionId-1";\r
@@ -630,6 +635,7 @@ public class DocumentTest {
         Assert.assertTrue(HttpStatus.FORBIDDEN.value() == response.getStatusCodeValue());\r
     }\r
 \r
+    @SuppressWarnings("unchecked")\r
     @Test\r
     public void testProcessDelete_IndexApi_DeleteIndexException() throws Exception {\r
         String transactionId = "transactionId-1";\r