LegacyUrlEnabledHelper { public boolean isEnabled() { return supportLegacyContent || isLegacyUrlCapabilityActive(); } @Inject  LegacyUrlEnabledHelper(final CapabilityRegistry capabilities); boolean isEnabled();  }
@Test public void enabledOnProperty() throws Exception { System.setProperty(LEGACY_ENABLED, "true"); undertTest = new LegacyUrlEnabledHelper(capabilityRegistry); assertThat(undertTest.isEnabled(), is(equalTo(true))); }
@Test public void enabledWhenCapabilityActive() throws Exception { when(capabilityContext.isActive()).thenReturn(true); assertThat(undertTest.isEnabled(), is(equalTo(true))); }
@Test public void disabledWhenPropertyFalseAndCapabilityNotActive() throws Exception { assertThat(undertTest.isEnabled(), is(equalTo(false))); }
@Test public void disabledWhenPropertyFalseAndCapabilityNotFound() throws Exception { when(capabilityContext.isActive()).thenReturn(true); when(capabilityRegistry.get(any(CapabilityReferenceFilter.class))).thenReturn(emptyList()); assertThat(undertTest.isEnabled(), is(equalTo(false))); }