Skip to content

Commit 4c6a9f4

Browse files
committed
/test/invalid/simple-html: port to using WireMock stub.
No functional changes.
1 parent 8197643 commit 4c6a9f4

File tree

7 files changed

+28
-10
lines changed

7 files changed

+28
-10
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,7 @@
987987
<variable>BROWSER:htmlunitwithjs</variable>
988988
<variable>MAIN_RESOURCE_DIR:${basedir}/src/main/resources/test</variable>
989989
<variable>TEST_RESOURCE_DIR:${basedir}/src/test/resources</variable>
990+
<variable>MOCK_SERVER:http://127.0.0.1:8888</variable>
990991
<!-- See also ru.mystamps.web.Url.SITE constant -->
991992
<variable>SITE_URL:http://127.0.0.1:8080</variable>
992993
</variables>

src/main/java/ru/mystamps/web/controller/TestController.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@ public String simpleJson() {
6060
return "test";
6161
}
6262

63-
@GetMapping("/test/invalid/simple-html")
64-
public void simpleHtml(HttpServletResponse response) throws IOException {
65-
printHtml(
66-
response,
67-
"<!DOCTYPE html><html><head><title>test</title></head><body>test</body></html>"
68-
);
69-
}
70-
7163
@GetMapping("/test/valid/series-info/existing-seller")
7264
public void seriesInfoWithExistingSeller(HttpServletResponse response) throws IOException {
7365
printHtml(

src/main/resources/application-test.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ app.site-parser[1].seller-locator = #test-seller
5959
app.site-parser[1].price-locator = #test-price
6060
app.site-parser[1].currency-value = RUB
6161

62+
app.site-parser[2].name = mockserver
63+
app.site-parser[2].matched-url = http://127.0.0.1:8888
64+
app.site-parser[2].image-url-locator = #series-image-link-1
65+
app.site-parser[2].short-description-locator = .dl-horizontal
66+
app.site-parser[2].seller-locator = #test-seller
67+
app.site-parser[2].price-locator = #test-price
68+
app.site-parser[2].currency-value = RUB
69+
6270
# Full list of autoconfiguration classes:
6371
# http://docs.spring.io/spring-boot/docs/1.5.x/reference/html/auto-configuration-classes.html
6472
spring.autoconfigure.exclude: \

src/main/resources/application-travis.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ app.site-parser[1].seller-locator = #test-seller
5656
app.site-parser[1].price-locator = #test-price
5757
app.site-parser[1].currency-value = RUB
5858

59+
app.site-parser[2].name = mockserver
60+
app.site-parser[2].matched-url = http://127.0.0.1:8888
61+
app.site-parser[2].image-url-locator = #series-image-link-1
62+
app.site-parser[2].short-description-locator = .dl-horizontal
63+
app.site-parser[2].seller-locator = #test-seller
64+
app.site-parser[2].price-locator = #test-price
65+
app.site-parser[2].currency-value = RUB
66+
5967
# Full list of autoconfiguration classes:
6068
# http://docs.spring.io/spring-boot/docs/1.5.x/reference/html/auto-configuration-classes.html
6169
# The difference between test profile is that we don't need H2ConsoleAutoConfiguration

src/main/scripts/ci/check-build-and-verify.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
135135
print_status "$POM_STATUS" 'Check sorting of pom.xml'
136136

137137
if [ "$BOOTLINT_STATUS" != 'skip' ]; then
138-
find src -type f -name '*.html' -print0 | xargs -0 bootlint \
138+
find src/main -type f -name '*.html' -print0 | xargs -0 bootlint \
139139
>bootlint.log 2>&1 || BOOTLINT_STATUS=fail
140140
fi
141141
print_status "$BOOTLINT_STATUS" 'Run bootlint'

src/test/robotframework/series/import/request-logic.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Submit a request that will fail to download a file
145145

146146
Submit a request with a document that couldn't be parsed
147147
[Documentation] Verify submitting a URL with an empty HTML document
148-
Input Text id=url ${SITE_URL}/test/invalid/simple-html
148+
Input Text id=url ${MOCK_SERVER}/series/import/request-logic/simple.html
149149
Submit Form id=import-series-form
150150
Element Text Should Be id=request-status ParsingFailed
151151

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>test</title>
5+
</head>
6+
<body>
7+
test
8+
</body>
9+
</html>

0 commit comments

Comments
 (0)