Skip to content

Commit 3d8d3f6

Browse files
authored
support favicon.ico in tests (#777)
1 parent 58fd97d commit 3d8d3f6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/java/com/arpnetworking/metrics/portal/reports/impl/chrome/BaseChromeTestSuite.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package com.arpnetworking.metrics.portal.reports.impl.chrome;
1717

18+
import com.github.tomakehurst.wiremock.client.WireMock;
1819
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
1920
import com.github.tomakehurst.wiremock.junit.WireMockRule;
2021
import com.google.common.collect.ImmutableList;
@@ -24,6 +25,7 @@
2425
import com.typesafe.config.ConfigUtil;
2526
import models.internal.TimeRange;
2627
import org.junit.Assume;
28+
import org.junit.Before;
2729
import org.junit.BeforeClass;
2830
import org.junit.Rule;
2931

@@ -138,4 +140,16 @@ private static boolean isPathExecutable(final String path) {
138140
public static void setUpClass() {
139141
Assume.assumeTrue("could not find Chrome in any likely location", CHROME_PATH.isPresent());
140142
}
143+
144+
/**
145+
* Handles setup for all tests. Chrome will request favicon.ico so we need to support it.
146+
*/
147+
@Before
148+
public void setUp() {
149+
_wireMock.givenThat(
150+
WireMock.get(WireMock.urlEqualTo("/favicon.ico"))
151+
.willReturn(WireMock.aResponse()
152+
.withStatus(404)
153+
.withBody("Not Found")));
154+
}
141155
}

0 commit comments

Comments
 (0)