FirmwareFileCachingRepository implements CachingRepository<String, byte[]> { @Override public boolean isAvailable(final String key) { return this.cache.containsKey(key); } FirmwareFileCachingRepository(); protected  FirmwareFileCachingRepository(final Map<String, byte[]> cache); @Override boolean isAvailable(final String key); @Override byte[] retrieve(final String key); @Override void store(final String key, final byte[] value);  }
@Test public void isAvailableShouldReturnTrueWhenFirmwareFileInCache() { final boolean actual = this.firmwareFileCachingRepostitory.isAvailable(FIRMWARE_IDENTIFICATION); assertThat(actual).isTrue(); }
@Test public void isAvailableShouldReturnFalseWhenFirmwareFileNotInCache() { final boolean actual = this.firmwareFileCachingRepostitory.isAvailable(FIRMWARE_IDENTIFICATION_UNAVAILABLE); assertThat(actual).isFalse(); }