CocoapodsProxyRecipe extends RecipeSupport { @Override public boolean isFeatureEnabled() { return highAvailabilitySupportChecker.isSupported(getFormat().getValue()); } @Inject  CocoapodsProxyRecipe(@Named(ProxyType.NAME) Type type, @Named(CocoapodsFormat.NAME) Format format); @Override void apply(final Repository repository); @Override boolean isFeatureEnabled(); static final String NAME; }
@Test public void testEnabledIfHaCheckPassed() { when(highAvailabilitySupportChecker.isSupported(COCOAPODS_NAME)).thenReturn(true); assertThat(underTest.isFeatureEnabled(), is(equalTo(true))); verify(highAvailabilitySupportChecker).isSupported(COCOAPODS_NAME); }
@Test public void testDisabledIfHaCheckReturnsFalse() { when(highAvailabilitySupportChecker.isSupported(COCOAPODS_NAME)).thenReturn(false); assertThat(underTest.isFeatureEnabled(), is(equalTo(false))); verify(highAvailabilitySupportChecker).isSupported(COCOAPODS_NAME); }