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
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
\r
}\r
\r
- //\r
+ @SuppressWarnings("unchecked")\r
@Test\r
public void testProcessSearchWithGet_ValidateThrowsException() throws Exception {\r
String transactionId = "transactionId-1";\r
\r
}\r
\r
- //\r
@Test\r
public void testProcessSearchWithGet_ValidateIsFalse() throws Exception {\r
String transactionId = "transactionId-1";\r
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
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
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
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
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
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
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
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
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