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

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

Introduction

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

Prototype

@Override
    @Nullable
    public Object getProperty(String name) 

Source Link

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 w w w .j a v a  2  s.  co  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));
        }//from www. j  a  v  a 2  s . c om
    }
    return source;
}