@Test
void handlesOneSsldPendingFirmwareUpdateRetrievingFirmwareVersion() throws Exception {

    final String deviceIdentification = "Test-SSLD-1";
    final Ssld ssld = new Ssld(deviceIdentification);
    final String correlationUid = "correlation-uid-pending-firmware-update";
    final SsldPendingFirmwareUpdate ssldPendingFirmwareUpdate = this.anSsldPendingFirmwareUpdate(1L, new Date(),
            deviceIdentification, correlationUid);
    final Organisation organisation = new Organisation(ssldPendingFirmwareUpdate.getOrganisationIdentification(),
            "Organisation", "ORG", PlatformFunctionGroup.USER);
    when(this.ssldPendingFirmwareUpdateRepository.findByDeviceIdentification(deviceIdentification))
            .thenReturn(Collections.singletonList(ssldPendingFirmwareUpdate));
    when(this.deviceDomainService.searchActiveDevice(eq(deviceIdentification), any(ComponentType.class)))
            .thenReturn(ssld);
    when(this.organisationDomainService.searchOrganisation(organisation.getOrganisationIdentification()))
            .thenReturn(organisation);
    this.firmwareManagementService.handleSsldPendingFirmwareUpdate(deviceIdentification);
    verify(this.ssldPendingFirmwareUpdateRepository, never()).delete(ssldPendingFirmwareUpdate);
    /*
     * Verify the firmware version request is made for the device with the
     * SsldPendingFirmwareUpdate and that it uses the correlation UID from
     * SsldPendingFirmwareUpdate, as this is important for the way the
     * firmware version response will be treated later-on in a more complete
     * firmware update scenario than the fragment seen here in this unit
     * test.
     */
    this.assertFirmwareVersionRequested(organisation.getOrganisationIdentification(), deviceIdentification,
            correlationUid);
}