### Question:
IdentitySourceConfiguration { public static IdentitySourceConfiguration fromConfiguration() { checkState(Configuration.isInitialized(), "configuration not initialized"); String identitySource = Configuration.getString(IDENTITY_SOURCE_CONFIG, null).get(); String identitySourceSchema = Configuration.getString(IDENTITY_SOURCE_SCHEMA_CONFIG, identitySource).get(); String identitySourceSchemaAttribute = Configuration.getString( IDENTITY_SOURCE_SCHEMA_ATTRIBUTE_CONFIG, String.format(SCHEMA_ATTRIBUTE_FORMAT, identitySourceSchema)) .get(); return new Builder(identitySource) .setIdentitySourceSchema(identitySourceSchema) .setIdentitySourceSchemaAttribute(identitySourceSchemaAttribute) .build(); } private  IdentitySourceConfiguration(IdentitySourceConfiguration.Builder builder); String getIdentitySourceSchemaAttribute(); String getGroupNamespace(); String getIdentitySourceSchema(); String getIdentitySourceId(); static IdentitySourceConfiguration fromConfiguration(); static ImmutableMap<String, IdentitySourceConfiguration> getReferenceIdentitySourcesFromConfiguration(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testFromConfiguration() { Properties properties = new Properties(); properties.put("api.identitySourceId", "idSource1"); setupConfig.initConfig(properties); IdentitySourceConfiguration idSourceConfig = IdentitySourceConfiguration.fromConfiguration(); assertNotNull(idSourceConfig); assertEquals("idSource1", idSourceConfig.getIdentitySourceId()); assertEquals("idSource1", idSourceConfig.getIdentitySourceSchema()); assertEquals("idSource1_identifier", idSourceConfig.getIdentitySourceSchemaAttribute()); assertEquals("identitysources/idSource1", idSourceConfig.getGroupNamespace()); }
@Test public void testFromConfigurationMissingConfig() { setupConfig.initConfig(new Properties() ); thrown.expect(InvalidConfigurationException.class); IdentitySourceConfiguration.fromConfiguration(); }