Skip to content

Commit 5f0407e

Browse files
committed
/test/valid/series-info/existing-seller: port to using WireMock stub.
Also add <meta charset> tag to fix dislaying of the page in a browser. No functional changes.
1 parent d3f6dc8 commit 5f0407e

File tree

5 files changed

+19
-73
lines changed

5 files changed

+19
-73
lines changed

src/main/java/ru/mystamps/web/config/ControllersConfig.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.springframework.context.annotation.Bean;
2323
import org.springframework.context.annotation.Configuration;
2424
import org.springframework.context.annotation.Import;
25-
import org.springframework.context.annotation.Profile;
2625

2726
import lombok.RequiredArgsConstructor;
2827

@@ -131,11 +130,5 @@ public SitemapController getSitemapController() {
131130
public SuggestionController getSuggestionController() {
132131
return new SuggestionController(countryService);
133132
}
134-
135-
@Bean
136-
@Profile({ "test", "travis" })
137-
public TestController getTestController() {
138-
return new TestController();
139-
}
140133

141134
}

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

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/main/java/ru/mystamps/web/util/ControllerUtils.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
*/
1818
package ru.mystamps.web.util;
1919

20-
import java.io.IOException;
21-
22-
import javax.servlet.http.HttpServletResponse;
23-
2420
import org.springframework.web.util.UriComponentsBuilder;
2521

2622
public final class ControllerUtils {
@@ -36,10 +32,4 @@ public static String redirectTo(String url, Object... args) {
3632
return "redirect:" + dstUrl;
3733
}
3834

39-
public static void printHtml(HttpServletResponse response, String html) throws IOException {
40-
response.setContentType("text/html");
41-
response.setCharacterEncoding("UTF-8");
42-
response.getWriter().println(html);
43-
}
44-
4535
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Import series from external site with catalog numbers (use description locator)
8888

8989
Import series and series sale with existing seller from an external site
9090
[Documentation] Verify import series and sale (with existing seller)
91-
Input Text id=url http://localhost:8080/test/valid/series-info/existing-seller
91+
Input Text id=url ${MOCK_SERVER}/series/import/request-logic/existing-seller.html
9292
Submit Form id=import-series-form
9393
${requestLocation}= Get Location
9494
Should Match Regexp ${requestLocation} /series/import/request/\\d+
@@ -103,7 +103,7 @@ Import series and series sale with existing seller from an external site
103103
${currentDate}= Get Current Date result_format=%d.%m.%Y
104104
Element Text Should Be id=series-sale-1-info ${currentDate} Eicca Toppinen was selling for 111.00 RUB
105105
Link Should Point To id=series-sale-1-seller http://example.com/eicca-toppinen
106-
Link Should Point To id=series-sale-1-transaction http://localhost:8080/test/valid/series-info/existing-seller
106+
Link Should Point To id=series-sale-1-transaction ${MOCK_SERVER}/series/import/request-logic/existing-seller.html
107107
Go To ${requestLocation}
108108
# after importing a series, sale info at the request page should be shown as read-only
109109
Element Should Be Disabled id=seller
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Series info (existing seller))</title>
6+
</head>
7+
<body>
8+
Image: <a id="series-image-link-1" href="http://127.0.0.1:8080/image/1">series image</a><br />
9+
Seller: <a id="test-seller" href="http://example.com/eicca-toppinen">Eicca Toppinen</a><br />
10+
Price: <span id="test-price">111</span> RUB<br />
11+
<!--
12+
This is needed to simplify an integration test:
13+
required fields "category" and "quantity" will be filled automatically
14+
-->
15+
Info: <span class="dl-horizontal">Спорт, 3 марки</span>
16+
</body>
17+
</html>

0 commit comments

Comments
 (0)