use of org.opensmartgridplatform.domain.core.entities.SsldPendingFirmwareUpdate in project open-smart-grid-platform by OSGP.
the class FirmwareManagementServiceTest method testHandleGetFirmwareVersionWithMatchingFirmwareVersion.
@Test
void testHandleGetFirmwareVersionWithMatchingFirmwareVersion() {
final List<FirmwareVersionDto> firmwareVersionDtos = Collections.emptyList();
final SsldPendingFirmwareUpdate ssldPendingFirmwareUpdate = Mockito.mock(SsldPendingFirmwareUpdate.class);
final List<SsldPendingFirmwareUpdate> ssldPendingFirmwareUpdates = Collections.singletonList(ssldPendingFirmwareUpdate);
when(this.ssldPendingFirmwareUpdateRepository.findByDeviceIdentification(any(String.class))).thenReturn(ssldPendingFirmwareUpdates);
when(ssldPendingFirmwareUpdate.getCorrelationUid()).thenReturn(CORRELATION_IDS.getCorrelationUid());
when(ssldPendingFirmwareUpdate.getFirmwareModuleType()).thenReturn(FirmwareModuleType.SECURITY);
when(ssldPendingFirmwareUpdate.getFirmwareVersion()).thenReturn(VERSION_1);
when(this.domainCoreMapper.mapAsList(firmwareVersionDtos, FirmwareVersion.class)).thenReturn(Collections.singletonList(new FirmwareVersion(FirmwareModuleType.SECURITY, VERSION_1)));
this.firmwareManagementService.handleGetFirmwareVersionResponse(firmwareVersionDtos, CORRELATION_IDS, "messageType", 1, ResponseMessageResultType.OK, null);
verifyNoInteractions(this.webServiceResponseMessageSender);
verify(this.ssldPendingFirmwareUpdateRepository).delete(any());
}
Aggregations