Example usage for org.springframework.mock.env MockPropertySource setProperty

List of usage examples for org.springframework.mock.env MockPropertySource setProperty

Introduction

In this page you can find the example usage for org.springframework.mock.env MockPropertySource setProperty.

Prototype

public void setProperty(String name, Object value) 

Source Link

Document

Set the given property on the underlying Properties object.

Usage

From source file:com.cisco.cta.taxii.adapter.settings.PropertySourceHelper.java

public static MockPropertySource exclude(MockPropertySource all, String excludePrefix) {
    MockPropertySource source = new MockPropertySource();
    for (String key : all.getPropertyNames()) {
        if (!key.startsWith(excludePrefix)) {
            source.setProperty(key, all.getProperty(key));
        }//from  ww w .j  ava  2s .  c o m
    }
    return source;
}

From source file:com.cisco.cta.taxii.adapter.settings.SettingsConfigurationTest.java

private MockPropertySource exclude(MockPropertySource all, String excludePrefix) {
    MockPropertySource source = new MockPropertySource();
    for (String key : all.getPropertyNames()) {
        if (!key.startsWith(excludePrefix)) {
            source.setProperty(key, all.getProperty(key));
        }/*w w w  .  j  a v  a  2  s.com*/
    }
    return source;
}