@Test public void shouldNotRequireUpdateIfExtensionHasNoItemsXml() throws Exception { fireflyExtension = createExtension(EXTENSION_WITHOUT_ITEMS_XML, false); FireflyExtensionModel fireflyExtensionModel = mockExtension(mockState(NO_ITEMS_XML_MD5, null)); given(fireflyExtensionRepository.findByName(EXTENSION_WITHOUT_ITEMS_XML)).willReturn(fireflyExtensionModel); boolean updateRequired = fireflyExtension.isUpdateRequired(); assertFalse(updateRequired); }
public boolean isUpdateRequired() { try { FireflyExtensionModel fireflyExtensionModel = fireflyExtensionRepository.findByName(name); return !containsItemDefinitionHash(getItemsDefinitionHash(), relaxedMode ? fireflyExtensionModel.getStates() : asList(getLastState(fireflyExtensionModel))); } catch (FireflyExtensionRepository.FireflyExtensionNotFoundException e) { return true; } }
FireflyExtension { public boolean isUpdateRequired() { try { FireflyExtensionModel fireflyExtensionModel = fireflyExtensionRepository.findByName(name); return !containsItemDefinitionHash(getItemsDefinitionHash(), relaxedMode ? fireflyExtensionModel.getStates() : asList(getLastState(fireflyExtensionModel))); } catch (FireflyExtensionRepository.FireflyExtensionNotFoundException e) { return true; } } }
FireflyExtension { public boolean isUpdateRequired() { try { FireflyExtensionModel fireflyExtensionModel = fireflyExtensionRepository.findByName(name); return !containsItemDefinitionHash(getItemsDefinitionHash(), relaxedMode ? fireflyExtensionModel.getStates() : asList(getLastState(fireflyExtensionModel))); } catch (FireflyExtensionRepository.FireflyExtensionNotFoundException e) { return true; } } FireflyExtension(String name, File rootPath, FireflyExtensionRepository fireflyExtensionRepository, MigrationRepository migrationRepository, boolean relaxedMode); }
FireflyExtension { public boolean isUpdateRequired() { try { FireflyExtensionModel fireflyExtensionModel = fireflyExtensionRepository.findByName(name); return !containsItemDefinitionHash(getItemsDefinitionHash(), relaxedMode ? fireflyExtensionModel.getStates() : asList(getLastState(fireflyExtensionModel))); } catch (FireflyExtensionRepository.FireflyExtensionNotFoundException e) { return true; } } FireflyExtension(String name, File rootPath, FireflyExtensionRepository fireflyExtensionRepository, MigrationRepository migrationRepository, boolean relaxedMode); boolean isUpdateRequired(); boolean isHmcResetRequired(); void onHmcReset(PK migration); void onUpdate(PK migration); @Override String toString(); }
FireflyExtension { public boolean isUpdateRequired() { try { FireflyExtensionModel fireflyExtensionModel = fireflyExtensionRepository.findByName(name); return !containsItemDefinitionHash(getItemsDefinitionHash(), relaxedMode ? fireflyExtensionModel.getStates() : asList(getLastState(fireflyExtensionModel))); } catch (FireflyExtensionRepository.FireflyExtensionNotFoundException e) { return true; } } FireflyExtension(String name, File rootPath, FireflyExtensionRepository fireflyExtensionRepository, MigrationRepository migrationRepository, boolean relaxedMode); boolean isUpdateRequired(); boolean isHmcResetRequired(); void onHmcReset(PK migration); void onUpdate(PK migration); @Override String toString();  }