@Test public void testIsDefinitionAllowed() { when(metadata.getProfileId()).thenReturn(DEFAULT_PROFILE.getProfileId()); assertTrue(tested.isDefinitionIdAllowed(metadata).test(DEF1)); assertTrue(tested.isDefinitionIdAllowed(metadata).test(DEF2)); when(metadata.getProfileId()).thenReturn(PROFILE_DOMAIN_ID); assertTrue(tested.isDefinitionIdAllowed(metadata).test(DEF1)); assertFalse(tested.isDefinitionIdAllowed(metadata).test(DEF2)); }
public Predicate<String> isDefinitionIdAllowed(final Metadata metadata) { return getDefinitionProfile(metadata) .map(DomainProfile::definitionAllowedFilter) .orElse(defaultProfile.definitionAllowedFilter()); }
DomainProfileManager { public Predicate<String> isDefinitionIdAllowed(final Metadata metadata) { return getDefinitionProfile(metadata) .map(DomainProfile::definitionAllowedFilter) .orElse(defaultProfile.definitionAllowedFilter()); } }
DomainProfileManager { public Predicate<String> isDefinitionIdAllowed(final Metadata metadata) { return getDefinitionProfile(metadata) .map(DomainProfile::definitionAllowedFilter) .orElse(defaultProfile.definitionAllowedFilter()); } @Inject  DomainProfileManager(final DefinitionManager definitionManager,
                                final ProfileManager profileManager,
                                final FullProfile defaultProfile); }
DomainProfileManager { public Predicate<String> isDefinitionIdAllowed(final Metadata metadata) { return getDefinitionProfile(metadata) .map(DomainProfile::definitionAllowedFilter) .orElse(defaultProfile.definitionAllowedFilter()); } @Inject  DomainProfileManager(final DefinitionManager definitionManager,
                                final ProfileManager profileManager,
                                final FullProfile defaultProfile); List<String> getAllDefinitions(final Metadata metadata); Predicate<String> isDefinitionIdAllowed(final Metadata metadata); }
DomainProfileManager { public Predicate<String> isDefinitionIdAllowed(final Metadata metadata) { return getDefinitionProfile(metadata) .map(DomainProfile::definitionAllowedFilter) .orElse(defaultProfile.definitionAllowedFilter()); } @Inject  DomainProfileManager(final DefinitionManager definitionManager,
                                final ProfileManager profileManager,
                                final FullProfile defaultProfile); List<String> getAllDefinitions(final Metadata metadata); Predicate<String> isDefinitionIdAllowed(final Metadata metadata);  }