Skip to content

Commit

Permalink
Added assertions to positive cases
Browse files Browse the repository at this point in the history
Signed-off-by: Loganathan Sekar <[email protected]>
  • Loading branch information
Loganathan Sekar authored and Loganathan Sekar committed Mar 1, 2024
1 parent 755de35 commit adae376
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import io.mosip.registration.processor.core.code.ApiName;
import io.mosip.registration.processor.core.exception.ApisResourceAccessException;
import io.mosip.registration.processor.core.exception.util.PlatformErrorMessages;
import io.mosip.registration.processor.core.exception.util.PlatformSuccessMessages;
import io.mosip.registration.processor.core.http.ResponseWrapper;
import io.mosip.registration.processor.core.notification.template.generator.dto.ResponseDto;
import io.mosip.registration.processor.core.notification.template.generator.dto.SmsResponseDto;
Expand Down Expand Up @@ -131,6 +132,13 @@ public void testMessageSentUINGenerated() throws Exception {
completedEventDTO.setInstanceId("85425022110000120190117110505");
completedEventDTO.setResultCode("PROCESSED");
completedEventDTO.setWorkflowType("NEW");

when(auditLogRequestBuilder.createAuditRequestBuilder(anyString(), anyString(), anyString(), anyString(), anyString(), anyString(), anyString()))
.thenAnswer(invocation -> {
String moduleId = (String) invocation.getArguments()[0];
assertEquals(PlatformSuccessMessages.RPR_MESSAGE_SENDER_STAGE_SUCCESS.getMessage(), moduleId);
return null;
});

ResponseEntity<Void> res=notificationService.process(completedEventDTO);
assertEquals(200, res.getStatusCodeValue());
Expand Down Expand Up @@ -163,6 +171,13 @@ public void testMessageSentUINGenerated_regType_OPENCRVS_NEW() throws Exception
completedEventDTO.setInstanceId("85425022110000120190117110505");
completedEventDTO.setResultCode("PROCESSED");
completedEventDTO.setWorkflowType("OPENCRVS_NEW");

when(auditLogRequestBuilder.createAuditRequestBuilder(anyString(), anyString(), anyString(), anyString(), anyString(), anyString(), anyString()))
.thenAnswer(invocation -> {
String moduleId = (String) invocation.getArguments()[0];
assertEquals(PlatformSuccessMessages.RPR_MESSAGE_SENDER_STAGE_SUCCESS.getMessage(), moduleId);
return null;
});

ResponseEntity<Void> res=notificationService.process(completedEventDTO);
assertEquals(200, res.getStatusCodeValue());
Expand Down

0 comments on commit adae376

Please sign in to comment.