### Question:
BlueprintImpl implements Blueprint { @Override public void validateRequiredProperties() throws InvalidTopologyException, GPLLicenseNotAcceptedException { validator.validateRequiredProperties(); } BlueprintImpl(BlueprintEntity entity);  BlueprintImpl(String name, Collection<HostGroup> groups, Stack stack, Configuration configuration,
                       SecurityConfiguration security);  BlueprintImpl(String name, Collection<HostGroup> groups, Stack stack, Configuration configuration,
                       SecurityConfiguration security, Setting setting); String getName(); String getStackName(); String getStackVersion(); SecurityConfiguration getSecurity(); @Override Map<String, HostGroup> getHostGroups(); @Override HostGroup getHostGroup(String name); @Override Configuration getConfiguration(); @Override Setting getSetting(); @Override Collection<String> getServices(); @Override Collection<ServiceInfo> getServiceInfos(); @Override Collection<String> getComponents(String service); @Override String getRecoveryEnabled(String serviceName, String componentName); @Override String getCredentialStoreEnabled(String serviceName); @Override boolean shouldSkipFailure(); @Override Stack getStack(); @Override Collection<HostGroup> getHostGroupsForComponent(String component); @Override Collection<HostGroup> getHostGroupsForService(String service); @Override void validateTopology(); BlueprintEntity toEntity(); @Override void validateRequiredProperties(); boolean isValidConfigType(String configType); List<RepositorySetting> getRepositorySettings();  }### Answer:
@Test(expected = InvalidTopologyException.class) public void testValidateConfigurations__secretReference() throws InvalidTopologyException, GPLLicenseNotAcceptedException, NoSuchFieldException, IllegalAccessException { Map<String, Map<String, String>> group2Props = new HashMap<>(); Map<String, String> group2Category2Props = new HashMap<>(); group2Props.put("category2", group2Category2Props); group2Category2Props.put("prop2", "val"); hdfsProps.put("secret", "SECRET:hdfs-site:1:test"); replay(stack, group1, group2, serverConfig); Blueprint blueprint = new BlueprintImpl("test", hostGroups, stack, configuration, null); blueprint.validateRequiredProperties(); verify(stack, group1, group2, serverConfig); }
@Test(expected = GPLLicenseNotAcceptedException.class) public void testValidateConfigurations__gplIsNotAllowedCodecsProperty() throws InvalidTopologyException, GPLLicenseNotAcceptedException, NoSuchFieldException, IllegalAccessException { Map<String, Map<String, String>> lzoProperties = new HashMap<>(); lzoProperties.put("core-site", new HashMap<String, String>(){{ put(BlueprintValidatorImpl.CODEC_CLASSES_PROPERTY_NAME, "OtherCodec, " + BlueprintValidatorImpl.LZO_CODEC_CLASS); }}); Configuration lzoUsageConfiguration = new Configuration(lzoProperties, EMPTY_ATTRIBUTES, EMPTY_CONFIGURATION); serverConfig = setupConfigurationWithGPLLicense(false); replay(stack, group1, group2, serverConfig); Blueprint blueprint = new BlueprintImpl("test", hostGroups, stack, lzoUsageConfiguration, null); blueprint.validateRequiredProperties(); verify(stack, group1, group2, serverConfig); }
@Test(expected = GPLLicenseNotAcceptedException.class) public void testValidateConfigurations__gplIsNotAllowedLZOProperty() throws InvalidTopologyException, GPLLicenseNotAcceptedException, NoSuchFieldException, IllegalAccessException { Map<String, Map<String, String>> lzoProperties = new HashMap<>(); lzoProperties.put("core-site", new HashMap<String, String>(){{ put(BlueprintValidatorImpl.LZO_CODEC_CLASS_PROPERTY_NAME, BlueprintValidatorImpl.LZO_CODEC_CLASS); }}); Configuration lzoUsageConfiguration = new Configuration(lzoProperties, EMPTY_ATTRIBUTES, EMPTY_CONFIGURATION); serverConfig = setupConfigurationWithGPLLicense(false); replay(stack, group1, group2, serverConfig); Blueprint blueprint = new BlueprintImpl("test", hostGroups, stack, lzoUsageConfiguration, null); blueprint.validateRequiredProperties(); verify(stack, group1, group2, serverConfig); }