Package org.constretto

Examples of org.constretto.ConstrettoBuilder


    private static final String PASSWORD_PROPERTY = "PASSWORD";

    @Test
    public void prepareTests() {
        System.setProperty(PASSWORD_PROPERTY, "constretto");
        ConstrettoBuilder constrettoBuilder = new ConstrettoBuilder();
        constrettoBuilder
                .createEncryptedPropertiesStore(PASSWORD_PROPERTY)
                .addResource(Resource.create("classpath:encrypted.properties"))
                .done();
        ConstrettoConfiguration config = constrettoBuilder.getConfiguration();
        assertEquals("Testing a property", config.evaluateToString("encrypted_property"));
    }
View Full Code Here


        setProperty("locale.valid", "en_US");
        setProperty("locale.invalid", "no_PO");
        setProperty("array.of.strings", "[\"one\",\"two\",\"three\"]");
        setProperty("array.of.ints", "[\"1\",\"2\",\"3\"]");
        setProperty("map.of.int.float", "{\"1\":\"10\",\"2\":\"20\"}");
        configuration = new ConstrettoBuilder().createSystemPropertiesStore().getConfiguration();
    }
View Full Code Here

        @org.constretto.annotation.Configuration("key7")
        private String key;

        @Bean
        public static ConstrettoConfiguration constrettoConfiguration() {
            return new ConstrettoBuilder(true)
                    .createIniFileConfigurationStore()
                    .addResource(Resource.create("classpath:properties/test1.ini"))
                    .done()
                    .getConfiguration();
        }
View Full Code Here

    @Configuration
    @Constretto(enableAnnotationSupport = false, enablePropertyPlaceholder = false)
    public static class TestContextWithNoConstrettoBeanPostProcessors {

        public static ConstrettoConfiguration constrettoConfiguration() {
            return new ConstrettoBuilder(false).getConfiguration();
        }
View Full Code Here

    @org.springframework.context.annotation.Configuration
    public static class TestContext extends BasicConstrettoConfiguration {
        @Override
        public org.constretto.ConstrettoConfiguration constrettoConfiguration() {
            return new ConstrettoBuilder()
                    .createPropertiesStore()
                    .addResource(Resource.create("classpath:properties/test1.properties"))
                    .done()
                    .getConfiguration();
        }
View Full Code Here

    ConstrettoConfiguration config;

    @Before
    public void before() {
        config = new ConstrettoBuilder()
                .createPropertiesStore()
                .addResource(Resource.create("classpath:subClassData.properties"))
                .done()
                .getConfiguration();
    }
View Full Code Here

    ConstrettoConfiguration config;

    @Before
    public void before() {
        config = new ConstrettoBuilder()
                .createPropertiesStore()
                .addResource(Resource.create("classpath:subClassData.properties"))
                .done()
                .getConfiguration();
    }
View Full Code Here

    @Configuration
    public static class TestConfiguration {

        @Bean
        public static ConstrettoConfiguration constrettoConfiguration() {
            return new ConstrettoBuilder(true).getConfiguration();
        }
View Full Code Here

    @Tags
    List<String> currentEnvironment;

    @Test
    public void givenEnvironmentAnnotationOnTestClassWhenRunningTestThenConstrettoKnowsEnvironment() {
        ConstrettoConfiguration configuration = new ConstrettoBuilder().createSystemPropertiesStore().getConfiguration();
        configuration.on(this);
        String[] expected = {"purejunit", "test"};
        Assert.assertArrayEquals(expected, currentEnvironment.toArray(new String[0]));
    }
View Full Code Here

    @Test
    public void givenEnvironmentAnnotationOnTestClassWhenRunningTestThenConstrettoKnowsEnvironment() {
        String[] expected = {"purejunit", "test"};

        ConstrettoConfiguration configuration =
            new ConstrettoBuilder().createSystemPropertiesStore().getConfiguration();
        configuration.on(this);

        assertArrayEquals(expected, currentEnvironment.toArray(new String[0]));
    }
View Full Code Here

TOP

Related Classes of org.constretto.ConstrettoBuilder

Copyright © 2018 www.massapicom. 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.