private FakeContainerConfig(ContainerConfig defaultContainerConfig) { containers.put(ContainerConfig.DEFAULT_CONTAINER, defaultContainerConfig.getProperties(ContainerConfig.DEFAULT_CONTAINER)); containers.put(MOCK_CONTAINER, ImmutableMap.<String, Object>builder() .put(DefaultProxyUriManager.PROXY_HOST_PARAM, "www.mock.com") .build()); }
@Override public void testGetProperties() throws Exception { assertEquals(ImmutableSet.of("gadgets.container", "inherited", "expr"), config.getProperties("default").keySet()); }
@Override public void testGetProperties() throws Exception { assertEquals(ImmutableSet.of("gadgets.container", "inherited", "expr"), config.getProperties("default").keySet()); }
@Override public void testGetProperties() throws Exception { assertEquals(ImmutableSet.of("gadgets.container", "inherited", "expr"), config.getProperties("default").keySet()); }
@Test public void testGetProperties() throws Exception { assertEquals(ImmutableSet.of("gadgets.container", "inherited"), config.getProperties("default").keySet()); }
@Test public void testGetProperties() throws Exception { assertEquals(ImmutableSet.of("gadgets.container", "inherited"), config.getProperties("default").keySet()); }
@Test public void testGetProperties() throws Exception { assertEquals(ImmutableSet.of("gadgets.container", "inherited"), config.getProperties("default").keySet()); }
@Test public void testContainersAreMergedRecursively() throws Exception { // Data taken from the documentation for BasicContainerConfig#mergeParents Map<String, Object> defaultContainer = makeContainer("default", "base", "/gadgets/foo", "user", "peter", "map", ImmutableMap.of("latitude", 42, "longitude", -8), "data", ImmutableList.of("foo", "bar")); Map<String, Object> newContainer = makeContainer("new", "user", "anne", "colour", "green", "map", ImmutableMap.of("longitude", 130), "data", null); Map<String, Object> expectedContainer = makeContainer("new", "base", "/gadgets/foo", "user", "anne", "colour", "green", "map", ImmutableMap.of("latitude", 42, "longitude", 130), "data", null); config.newTransaction().addContainer(defaultContainer).addContainer(newContainer).commit(); assertEquals(expectedContainer, config.getProperties("new")); }
@Test public void testContainersAreMergedRecursively() throws Exception { // Data taken from the documentation for BasicContainerConfig#mergeParents Map<String, Object> defaultContainer = makeContainer("default", "base", "/gadgets/foo", "user", "peter", "map", ImmutableMap.of("latitude", 42, "longitude", -8), "data", ImmutableList.of("foo", "bar")); Map<String, Object> newContainer = makeContainer("new", "user", "anne", "colour", "green", "map", ImmutableMap.of("longitude", 130), "data", null); Map<String, Object> expectedContainer = makeContainer("new", "base", "/gadgets/foo", "user", "anne", "colour", "green", "map", ImmutableMap.of("latitude", 42, "longitude", 130), "data", null); config.newTransaction().addContainer(defaultContainer).addContainer(newContainer).commit(); assertEquals(expectedContainer, config.getProperties("new")); }
@Test public void testContainersAreMergedRecursively() throws Exception { // Data taken from the documentation for BasicContainerConfig#mergeParents Map<String, Object> defaultContainer = makeContainer("default", "base", "/gadgets/foo", "user", "peter", "map", ImmutableMap.of("latitude", 42, "longitude", -8), "data", ImmutableList.of("foo", "bar")); Map<String, Object> newContainer = makeContainer("new", "user", "anne", "colour", "green", "map", ImmutableMap.of("longitude", 130), "data", null); Map<String, Object> expectedContainer = makeContainer("new", "base", "/gadgets/foo", "user", "anne", "colour", "green", "map", ImmutableMap.of("latitude", 42, "longitude", 130), "data", null); config.newTransaction().addContainer(defaultContainer).addContainer(newContainer).commit(); assertEquals(expectedContainer, config.getProperties("new")); }