Search in sources :

Example 1 with StubApplicationInstanceInfo

use of org.springframework.cloud.CloudTestUtil.StubApplicationInstanceInfo in project spring-cloud-connectors by spring-cloud.

the class StubServiceConnectorConfig method appProps.

@Test
public void appProps() {
    Map<String, Object> appProps = new HashMap<String, Object>();
    appProps.put("foo", "bar");
    // on v2, users property is null
    appProps.put("users", null);
    StubCloudConnector stubCloudConnector = CloudTestUtil.getTestCloudConnector(new StubApplicationInstanceInfo("instance-id-1", "myapp", appProps));
    Cloud testCloud = new Cloud(stubCloudConnector, serviceConnectorCreators);
    assertEquals("myapp", testCloud.getCloudProperties().get("cloud.application.app-id"));
    assertEquals("instance-id-1", testCloud.getCloudProperties().get("cloud.application.instance-id"));
    assertEquals("bar", testCloud.getCloudProperties().get("cloud.application.foo"));
}
Also used : HashMap(java.util.HashMap) StubApplicationInstanceInfo(org.springframework.cloud.CloudTestUtil.StubApplicationInstanceInfo) StubCloudConnector(org.springframework.cloud.CloudTestUtil.StubCloudConnector) Test(org.junit.Test)

Aggregations

HashMap (java.util.HashMap)1 Test (org.junit.Test)1 StubApplicationInstanceInfo (org.springframework.cloud.CloudTestUtil.StubApplicationInstanceInfo)1 StubCloudConnector (org.springframework.cloud.CloudTestUtil.StubCloudConnector)1