Skip to content

Commit

Permalink
Allow for audit message order to change in testSourceFilterMsearch
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
peternied committed Oct 20, 2022
1 parent bd20a98 commit ec03ff4
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,16 @@ public void testSourceFilterMsearch() throws Exception {
Assert.assertEquals(HttpStatus.SC_OK, response.getStatusCode());
}, 2);

assertThat(messages.get(0).getCategory(), equalTo(AuditCategory.COMPLIANCE_DOC_READ));
assertThat(messages.get(0).getRequestBody(), containsString("Designation"));
assertThat(messages.get(0).getRequestBody(), not(containsString("Salary")));

assertThat(messages.get(1).getCategory(), equalTo(AuditCategory.COMPLIANCE_DOC_READ));
assertThat(messages.get(1).getRequestBody(), containsString("Gender"));
assertThat(messages.get(1).getRequestBody(), not(containsString("Salary")));
final AuditMessage desginationMsg = messages.stream().filter(msg -> msg.getRequestBody().contains("Designation")).findFirst().orElseThrow();
assertThat(desginationMsg.getCategory(), equalTo(AuditCategory.COMPLIANCE_DOC_READ));
assertThat(desginationMsg.getRequestBody(), containsString("Designation"));
assertThat(desginationMsg.getRequestBody(), not(containsString("Salary")));

final AuditMessage genderMsg = messages.stream().filter(msg -> msg.getRequestBody().contains("Gender")).findFirst().orElseThrow();
assertThat(genderMsg.getCategory(), equalTo(AuditCategory.COMPLIANCE_DOC_READ));
assertThat(genderMsg.getRequestBody(), containsString("Gender"));
assertThat(genderMsg.getRequestBody(), not(containsString("Salary")));

Assert.assertTrue(validateMsgs(messages));
}
Expand Down

0 comments on commit ec03ff4

Please sign in to comment.