Examples of evaluateToString()


Examples of org.constretto.ConstrettoConfiguration.evaluateToString()

  String password;

  public AltinnAuthorizationDecisionPointExternalClientCallback() {
    ConstrettoConfiguration config = new ConstrettoBuilder().createPropertiesStore().addResource(new DefaultResourceLoader().getResource("classpath:application.properties")).done().getConfiguration();
    password = config.evaluateToString("altinn.systemPassword");
  }

  @Override
  public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
    WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
View Full Code Here

Examples of org.constretto.ConstrettoConfiguration.evaluateToString()

        final LdapConfigurationStore ldapConfigurationStore = new LdapConfigurationStore(new LdapConfigurationStore(),
                attributes);

        final ConstrettoConfiguration constrettoConfiguration = createConfigurationForLdapConfigurationStore(ldapConfigurationStore);
        assertTrue(constrettoConfiguration.hasValue(attributeId));
        assertEquals(attributeValue, constrettoConfiguration.evaluateToString(attributeId));

        verify(attributes).getAll();
        verify(attributesNamingEnumeration, times(2)).hasMore();
        verify(attributesNamingEnumeration).next();
        verify(attribute, times(2)).getID();
View Full Code Here

Examples of org.constretto.ConstrettoConfiguration.evaluateToString()

    @Test
    public void givenTagDevelopmentThenProviderChoosesDevelopmentValues() {
        ConstrettoConfiguration configuration = new ConstrettoBuilder()
                .addConfigurationStore(store).addCurrentTag("development")
                .getConfiguration();
        assertEquals("development-url", configuration.evaluateToString("datasources.customer.url"));
    }

    @Test
    public void givenNoTagThenProviderChoosesDefaultValues() {
        ConstrettoConfiguration configuration = new ConstrettoBuilder().addConfigurationStore(store).getConfiguration();
View Full Code Here

Examples of org.constretto.ConstrettoConfiguration.evaluateToString()

    }

    @Test
    public void givenNoTagThenProviderChoosesDefaultValues() {
        ConstrettoConfiguration configuration = new ConstrettoBuilder().addConfigurationStore(store).getConfiguration();
        assertEquals("default-url", configuration.evaluateToString("datasources.customer.url"));
    }

    @Test
    public void givenTagProductionThenProviderChoosesProductionValues() {
        ConstrettoConfiguration configuration = new ConstrettoBuilder().addConfigurationStore(store).addCurrentTag("production")
View Full Code Here

Examples of org.constretto.ConstrettoConfiguration.evaluateToString()

    @Test
    public void givenTagProductionThenProviderChoosesProductionValues() {
        ConstrettoConfiguration configuration = new ConstrettoBuilder().addConfigurationStore(store).addCurrentTag("production")
                .getConfiguration();
        assertEquals("production-url", configuration.evaluateToString("datasources.customer.url"));
    }

    @Test
    public void givenNoTagAndFromRootThenProviderChoosesGenericValues() {
        ConstrettoConfiguration configuration = new ConstrettoBuilder(false).addConfigurationStore(store).getConfiguration();
View Full Code Here

Examples of org.constretto.ConstrettoConfiguration.evaluateToString()

    }

    @Test
    public void givenNoTagAndFromRootThenProviderChoosesGenericValues() {
        ConstrettoConfiguration configuration = new ConstrettoBuilder(false).addConfigurationStore(store).getConfiguration();
        assertEquals("generic-url", configuration.evaluateToString("url"));
    }


    @Override
    protected ConfigurationStore getStore() {
View Full Code Here

Examples of org.constretto.ConstrettoConfiguration.evaluateToString()

    public void whenResetingTagsItResolvesBackToOriginalTags() {
        ConstrettoConfiguration configuration = new ConstrettoBuilder()
                .createPropertiesStore().addResource(new ClassPathResource("dynamic.properties")).done()
                .addCurrentTag("test")
                .getConfiguration();
        assertEquals("test value", configuration.evaluateToString("stagedKey"));
        configuration.prependTag("prod");
        assertEquals("prod value", configuration.evaluateToString("stagedKey"));
        configuration.resetTags(true);
        assertEquals("test value", configuration.evaluateToString("stagedKey"));
    }
View Full Code Here

Examples of org.constretto.ConstrettoConfiguration.evaluateToString()

                .createPropertiesStore().addResource(new ClassPathResource("dynamic.properties")).done()
                .addCurrentTag("test")
                .getConfiguration();
        assertEquals("test value", configuration.evaluateToString("stagedKey"));
        configuration.prependTag("prod");
        assertEquals("prod value", configuration.evaluateToString("stagedKey"));
        configuration.resetTags(true);
        assertEquals("test value", configuration.evaluateToString("stagedKey"));
    }

View Full Code Here

Examples of org.constretto.ConstrettoConfiguration.evaluateToString()

                .getConfiguration();
        assertEquals("test value", configuration.evaluateToString("stagedKey"));
        configuration.prependTag("prod");
        assertEquals("prod value", configuration.evaluateToString("stagedKey"));
        configuration.resetTags(true);
        assertEquals("test value", configuration.evaluateToString("stagedKey"));
    }


    @Test
    public void whenClearingTagsItResolvesBackToDefaultValues() {
View Full Code Here

Examples of org.constretto.ConstrettoConfiguration.evaluateToString()

    public void whenClearingTagsItResolvesBackToDefaultValues() {
        ConstrettoConfiguration configuration = new ConstrettoBuilder()
                .createPropertiesStore().addResource(new ClassPathResource("dynamic.properties")).done()
                .addCurrentTag("test")
                .getConfiguration();
        assertEquals("test value", configuration.evaluateToString("stagedKey"));
        configuration.prependTag("prod");
        assertEquals("prod value", configuration.evaluateToString("stagedKey"));
        configuration.clearTags(true);
        assertEquals("default value", configuration.evaluateToString("stagedKey"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.