@Test public void testImportsAndBackgroundUrlsInStyleTagDefaultContainer() throws Exception { // TODO: IMPORTANT! This test needs to not rely on the packaged shindig config, but rather // mock the config with expected values, so that tests do not fail when people set // alternative defaults. Config config = injector.getInstance(ContentRewriterFeature.DefaultConfig.class); EasyMock.replay(); if (config.isRewriteEnabled()) testImportsAndBackgroundUrlsInStyleTag(ORIGINAL, EXPECTED, ContainerConfig.DEFAULT_CONTAINER, config); else testImportsAndBackgroundUrlsInStyleTag(ORIGINAL, NOREWRITE, ContainerConfig.DEFAULT_CONTAINER, config); }
@Test public void testImportsAndBackgroundUrlsInStyleTagMockContainer() throws Exception { testImportsAndBackgroundUrlsInStyleTag(ORIGINAL, EXPECTED.replace( "localhost:8080/gadgets/proxy?container=default", "www.mock.com/gadgets/proxy?container=mock"), MOCK_CONTAINER); }
@Test public void testImportsAndBackgroundUrlsInStyleTagDefaultContainer() throws Exception { // TODO: IMPORTANT! This test needs to not rely on the packaged shindig config, but rather // mock the config with expected values, so that tests do not fail when people set // alternative defaults. Config config = injector.getInstance(ContentRewriterFeature.DefaultConfig.class); EasyMock.replay(); if (config.isRewriteEnabled()) testImportsAndBackgroundUrlsInStyleTag(ORIGINAL, EXPECTED, ContainerConfig.DEFAULT_CONTAINER, config); else testImportsAndBackgroundUrlsInStyleTag(ORIGINAL, NOREWRITE, ContainerConfig.DEFAULT_CONTAINER, config); }
@Test public void testImportsAndBackgroundUrlsInStyleTagMockContainer() throws Exception { // TODO: IMPORTANT! This test needs to not rely on the packaged shindig config, but rather // mock the config with expected values, so that tests do not fail when people set // alternative defaults. Config config = injector.getInstance(ContentRewriterFeature.DefaultConfig.class); EasyMock.replay(); if (config.isRewriteEnabled()) { testImportsAndBackgroundUrlsInStyleTag(ORIGINAL, EXPECTED.replace( "localhost:8080/gadgets/proxy?container=default", "www.mock.com/gadgets/proxy?container=mock"), MOCK_CONTAINER, config); } else { testImportsAndBackgroundUrlsInStyleTag(ORIGINAL, NOREWRITE, ContainerConfig.DEFAULT_CONTAINER, config); } }
@Test public void testImportsAndBackgroundUrlsInStyleTagDefaultContainer() throws Exception { testImportsAndBackgroundUrlsInStyleTag(ORIGINAL, EXPECTED, ContainerConfig.DEFAULT_CONTAINER); }
@Test public void testImportsAndBackgroundUrlsInStyleTagMockContainer() throws Exception { // TODO: IMPORTANT! This test needs to not rely on the packaged shindig config, but rather // mock the config with expected values, so that tests do not fail when people set // alternative defaults. Config config = injector.getInstance(ContentRewriterFeature.DefaultConfig.class); EasyMock.replay(); if (config.isRewriteEnabled()) { testImportsAndBackgroundUrlsInStyleTag(ORIGINAL, EXPECTED.replace( "localhost:8080/gadgets/proxy?container=default", "www.mock.com/gadgets/proxy?container=mock"), MOCK_CONTAINER, config); } else { testImportsAndBackgroundUrlsInStyleTag(ORIGINAL, NOREWRITE, ContainerConfig.DEFAULT_CONTAINER, config); } }