Skip to content

Commit

Permalink
test: Remove test ignores by wire mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
RehanChalana committed Nov 2, 2024
1 parent eafc546 commit e699ee3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,10 @@ class BrokenHttpLinksCheckerSpec extends Specification {
}


@Ignore // If({ !System.getenv('GITHUB_ACTIONS') })
def "bad amazon link is identified as problem"() {

given: "an HTML page with a single (good) amazon link"
String badAmazonLink = "https://www.amazon.com/dp/4242424242"
String badAmazonLink = "https://www.amazon.com:$port/dp/4242424242"
String HTML = """$HtmlConst.HTML_HEAD
<a href=${badAmazonLink}>Amazon</a>
$HtmlConst.HTML_END """
Expand Down Expand Up @@ -228,12 +227,12 @@ class BrokenHttpLinksCheckerSpec extends Specification {

}

@Ignore

def 'redirects are recognized and their new location is contained in warning message'() {

given: "the old arc42 (http!) page "
String HTML = """$HtmlConst.HTML_HEAD
<a href="https://arc42.de"</a>
<a href="http://arc42.de:$port/old"</a>
$HtmlConst.HTML_END """

htmlPage = new HtmlPage(HTML)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public class CustomHostNameResolver {
"plumelib.org",
"people.csail.mit.edu",
"arc42.org",
"mock.codes"
"mock.codes",
"arc42.de"
);

static {
Expand Down
14 changes: 13 additions & 1 deletion htmlSanityCheck-core/src/test/resources/mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
{
"request": {
"method": "GET_OR_HEAD",
"urlPattern": "/403"
"urlPattern": "/(403 | dp/4242424242)"
},
"response": {
"status": 403,
Expand Down Expand Up @@ -285,6 +285,18 @@
"Content-Type": "text/plain"
}
}
},
{
"request": {
"method": "GET_OR_HEAD",
"urlPattern": "/old"
},
"response": {
"status": 302,
"headers": {
"Location": "https://arc42.de"
}
}
}
]
}

0 comments on commit e699ee3

Please sign in to comment.