Search in sources :

Example 1 with StaticConfiguration

use of io.jans.as.model.config.StaticConfiguration in project jans by JanssenProject.

the class ConfSerialization method claims.

@Test
public void claims() throws IOException {
    final BaseDnConfiguration baseDn = new BaseDnConfiguration();
    baseDn.setConfiguration("ou=configuration,o=jans");
    baseDn.setPeople("ou=people,o=jans");
    baseDn.setClients("ou=clients,o=jans");
    baseDn.setScopes("ou=scopes,o=jans");
    baseDn.setAttributes("ou=attributes,o=jans");
    final StaticConfiguration c = new StaticConfiguration();
    c.setBaseDn(baseDn);
    final String jsonStr = ServerUtil.createJsonMapper().writeValueAsString(c);
    System.out.println(jsonStr);
}
Also used : StaticConfiguration(io.jans.as.model.config.StaticConfiguration) BaseDnConfiguration(io.jans.as.model.config.BaseDnConfiguration) Test(org.testng.annotations.Test)

Example 2 with StaticConfiguration

use of io.jans.as.model.config.StaticConfiguration in project jans by JanssenProject.

the class ConfigurationTest method createLatestTestConfInLdapFromFiles.

/*
     * Useful test method to get create newest test configuration. It shouldn't
     * be used directly for testing.
     */
// @Test
public void createLatestTestConfInLdapFromFiles() throws Exception {
    final String prefix = "U:\\own\\project\\jans-auth\\server\\src\\test\\resources\\conf";
    final String errorsFile = prefix + "\\oxauth-errors.json";
    final String staticFile = prefix + "\\oxauth-static-conf.json";
    final String webKeysFile = prefix + "\\oxauth-web-keys.json";
    final String configFile = prefix + "\\oxauth-config.xml";
    final String errorsJson = IOUtils.toString(new FileInputStream(errorsFile));
    final String staticConfJson = IOUtils.toString(new FileInputStream(staticFile));
    final String webKeysJson = IOUtils.toString(new FileInputStream(webKeysFile));
    final StaticConfiguration staticConf = ServerUtil.createJsonMapper().readValue(staticConfJson, StaticConfiguration.class);
    final ErrorMessages errorConf = ServerUtil.createJsonMapper().readValue(errorsJson, ErrorMessages.class);
    final WebKeysConfiguration webKeys = ServerUtil.createJsonMapper().readValue(webKeysJson, WebKeysConfiguration.class);
    final AppConfiguration configJson = loadConfFromFile(configFile);
    final Conf c = new Conf();
    c.setDn("ou=testconfiguration,o=jans");
    c.setDynamic(configJson);
    c.setErrors(errorConf);
    c.setStatics(staticConf);
    c.setWebKeys(webKeys);
    ldapEntryManager.persist(c);
}
Also used : ErrorMessages(io.jans.as.model.error.ErrorMessages) WebKeysConfiguration(io.jans.as.model.config.WebKeysConfiguration) Conf(io.jans.as.model.config.Conf) AppConfiguration(io.jans.as.model.configuration.AppConfiguration) StaticConfiguration(io.jans.as.model.config.StaticConfiguration) FileInputStream(java.io.FileInputStream)

Aggregations

StaticConfiguration (io.jans.as.model.config.StaticConfiguration)2 BaseDnConfiguration (io.jans.as.model.config.BaseDnConfiguration)1 Conf (io.jans.as.model.config.Conf)1 WebKeysConfiguration (io.jans.as.model.config.WebKeysConfiguration)1 AppConfiguration (io.jans.as.model.configuration.AppConfiguration)1 ErrorMessages (io.jans.as.model.error.ErrorMessages)1 FileInputStream (java.io.FileInputStream)1 Test (org.testng.annotations.Test)1