org.springframework.mock.env

Class MockPropertySource

    • Constructor Detail

      • MockPropertySource

        public MockPropertySource()
        Create a new MockPropertySource named "mockProperties" that will maintain its own internal Properties instance.
      • MockPropertySource

        public MockPropertySource(java.lang.String name)
        Create a new MockPropertySource with the given name that will maintain its own internal Properties instance.
        Parameters:
        name - the name of the property source
      • MockPropertySource

        public MockPropertySource(java.util.Properties properties)
        Create a new MockPropertySource named "mockProperties" and backed by the given Properties object.
        Parameters:
        properties - the properties to use
      • MockPropertySource

        public MockPropertySource(java.lang.String name,
                                  java.util.Properties properties)
        Create a new MockPropertySource with the given name and backed by the given Properties object.
        Parameters:
        name - the name of the property source
        properties - the properties to use
    • Method Detail

      • setProperty

        public void setProperty(java.lang.String name,
                                java.lang.Object value)
        Set the given property on the underlying Properties object.