FirmwareService { public boolean isFirmwareFileAvailable(final String firmwareIdentification) { return this.firmwareRepository.isAvailable(firmwareIdentification); }  List<FirmwareVersionDto> getFirmwareVersions(final DlmsConnectionManager conn, final DlmsDevice device); UpdateFirmwareResponseDto updateFirmware(final DlmsConnectionManager conn, final DlmsDevice device,
            final String firmwareIdentification); UpdateFirmwareResponseDto updateFirmware(final DlmsConnectionManager conn, final DlmsDevice device,
            final FirmwareFileDto firmwareFileDto); boolean isFirmwareFileAvailable(final String firmwareIdentification);  }
@Test public void isFirmwareAvailableShouldReturnTrueWhenFirmwareFileAvailable() { final String firmwareIdentification = "unavailable"; when(this.firmwareFileCachingRepository.isAvailable(firmwareIdentification)).thenReturn(true); final boolean expected = true; final boolean actual = this.firmwareService.isFirmwareFileAvailable(firmwareIdentification); assertThat(actual).isEqualTo(expected); }
@Test public void isFirmwareAvailableShouldReturnFalseWhenFirmwareFileNotAvailable() { final String firmwareIdentification = "unavailable"; when(this.firmwareFileCachingRepository.isAvailable(firmwareIdentification)).thenReturn(false); final boolean expected = false; final boolean actual = this.firmwareService.isFirmwareFileAvailable(firmwareIdentification); assertThat(actual).isEqualTo(expected); }