@Test public void shouldAlwaysAllowOwnInstance() { final String own = "fi-dev"; setFilter(NONE.name()); FederationConfigurationSourceFilter filter = new FederationConfigurationSourceFilterImpl(own); assertThat(filter.shouldDownloadConfigurationFor(" "), is(false)); assertThat(filter.shouldDownloadConfigurationFor(" "), is(false)); assertThat(filter.shouldDownloadConfigurationFor("dev-fi"), is(false)); assertThat(filter.shouldDownloadConfigurationFor(DEFAULT_OWN_INSTANCE), is(false)); assertThat(filter.shouldDownloadConfigurationFor(own), is(true)); }
@Override public boolean shouldDownloadConfigurationFor(String instanceIdentifier) { if (ownInstance.equalsIgnoreCase(instanceIdentifier)) { return true; } switch (allowedFederationMode) { case CUSTOM: return allowedFederationPartners.contains(instanceIdentifier); case ALL: return true; default: return false; } }
FederationConfigurationSourceFilterImpl implements FederationConfigurationSourceFilter { @Override public boolean shouldDownloadConfigurationFor(String instanceIdentifier) { if (ownInstance.equalsIgnoreCase(instanceIdentifier)) { return true; } switch (allowedFederationMode) { case CUSTOM: return allowedFederationPartners.contains(instanceIdentifier); case ALL: return true; default: return false; } } }
FederationConfigurationSourceFilterImpl implements FederationConfigurationSourceFilter { @Override public boolean shouldDownloadConfigurationFor(String instanceIdentifier) { if (ownInstance.equalsIgnoreCase(instanceIdentifier)) { return true; } switch (allowedFederationMode) { case CUSTOM: return allowedFederationPartners.contains(instanceIdentifier); case ALL: return true; default: return false; } } FederationConfigurationSourceFilterImpl(String ownInstance); }
FederationConfigurationSourceFilterImpl implements FederationConfigurationSourceFilter { @Override public boolean shouldDownloadConfigurationFor(String instanceIdentifier) { if (ownInstance.equalsIgnoreCase(instanceIdentifier)) { return true; } switch (allowedFederationMode) { case CUSTOM: return allowedFederationPartners.contains(instanceIdentifier); case ALL: return true; default: return false; } } FederationConfigurationSourceFilterImpl(String ownInstance); @Override boolean shouldDownloadConfigurationFor(String instanceIdentifier); }
FederationConfigurationSourceFilterImpl implements FederationConfigurationSourceFilter { @Override public boolean shouldDownloadConfigurationFor(String instanceIdentifier) { if (ownInstance.equalsIgnoreCase(instanceIdentifier)) { return true; } switch (allowedFederationMode) { case CUSTOM: return allowedFederationPartners.contains(instanceIdentifier); case ALL: return true; default: return false; } } FederationConfigurationSourceFilterImpl(String ownInstance); @Override boolean shouldDownloadConfigurationFor(String instanceIdentifier);  }