Skip to content

Commit

Permalink
[Mosip-27859] [ MOSIP-29896 ] Adding pkt_cr_dtimes and setting the pa…
Browse files Browse the repository at this point in the history
…cket date and time from metadata of the packet

Signed-off-by: khuddus shariff <[email protected]>
  • Loading branch information
Khuddusshariff0022 committed Nov 6, 2023
1 parent 5970209 commit 6602518
Showing 1 changed file with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,15 @@ public void PacketValidationSuccessTestwithPacketCreatedDateTimeInvalidFormat()
Mockito.verify(registrationStatusService,Mockito.atLeastOnce()).updateRegistrationStatus(argument.capture(),any(),any());
assertEquals(null, argument.getAllValues().get(0).getPacketCreateDateTime());
}


@Test
public void PacketValidationFailureTest() throws PacketValidatorException, ApisResourceAccessException, JsonProcessingException, RegistrationProcessorCheckedException, IOException, PacketManagerException {
registrationStatusDto.setRetryCount(1);
Mockito.when(packetValidator.validate(any(), any(),any())).thenReturn(false);
MessageDTO object = packetValidateProcessor.process(messageDTO, stageName);
assertFalse(object.getIsValid());
assertFalse(object.getInternalError());
}
@Test
public void PacketValidationPacketManagerFailedTest()
throws ApisResourceAccessException, PacketManagerException, JsonProcessingException, IOException {
Expand All @@ -310,7 +318,17 @@ public void PacketValidationPacketManagerFailedTest()
assertTrue(object.getIsValid());
assertTrue(object.getInternalError());
}


@Test
public void invalidSupervisorStatusTest() throws PacketValidatorException {
registrationStatusDto.setRetryCount(1);
regEntity=new SyncRegistrationEntity();
regEntity.setSupervisorStatus("REJECTED");
Mockito.when(syncRegistrationService.findByWorkflowInstanceId(any())).thenReturn(regEntity);
MessageDTO object = packetValidateProcessor.process(messageDTO, stageName);
assertFalse(object.getIsValid());
assertFalse(object.getInternalError());
}
@Test
public void PacketValidationParsingFailedTest()
throws ApisResourceAccessException, PacketManagerException, JsonProcessingException, IOException {
Expand Down

0 comments on commit 6602518

Please sign in to comment.