use of org.apache.metron.indexing.dao.update.CommentAddRemoveRequest in project metron by apache.
the class UpdateControllerIntegrationTest method shouldAddComment.
@Test
public void shouldAddComment() throws Exception {
CommentAddRemoveRequest commentAddRemoveRequest = new CommentAddRemoveRequest();
commentAddRemoveRequest.setGuid("bro_1");
commentAddRemoveRequest.setSensorType("bro");
commentAddRemoveRequest.setComment("test_comment");
commentAddRemoveRequest.setUsername("test_username");
commentAddRemoveRequest.setTimestamp(0L);
updateService.addComment(commentAddRemoveRequest);
ResultActions result = this.mockMvc.perform(post(updateUrl + "/add/comment").with(httpBasic(user, password)).with(csrf()).contentType(MediaType.parseMediaType("application/json;charset=UTF-8")).content(addComment));
result.andExpect(status().isOk());
}
use of org.apache.metron.indexing.dao.update.CommentAddRemoveRequest in project metron by apache.
the class UpdateControllerIntegrationTest method shouldRemoveComment.
@Test
public void shouldRemoveComment() throws Exception {
CommentAddRemoveRequest commentAddRemoveRequest = new CommentAddRemoveRequest();
commentAddRemoveRequest.setGuid("bro_1");
commentAddRemoveRequest.setSensorType("bro");
commentAddRemoveRequest.setComment("test_comment");
commentAddRemoveRequest.setUsername("test_username");
commentAddRemoveRequest.setTimestamp(0L);
updateService.removeComment(commentAddRemoveRequest);
ResultActions result = this.mockMvc.perform(post(updateUrl + "/remove/comment").with(httpBasic(user, password)).with(csrf()).contentType(MediaType.parseMediaType("application/json;charset=UTF-8")).content(removeComment));
result.andExpect(status().isOk());
}
Aggregations