Skip to content

Commit 105647d

Browse files
committed
/test/invalid/response-301: port to using WireMock stub.
No functional changes.
1 parent 4c6a9f4 commit 105647d

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,11 @@
2525
import org.springframework.web.bind.annotation.GetMapping;
2626
import org.springframework.web.bind.annotation.ResponseBody;
2727

28-
import ru.mystamps.web.Url;
29-
3028
import static ru.mystamps.web.util.ControllerUtils.printHtml;
3129

3230
@Controller
3331
public class TestController {
3432

35-
@GetMapping("/test/invalid/response-301")
36-
public void redirect(HttpServletResponse response) {
37-
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
38-
response.setHeader("Location", Url.SITE);
39-
}
40-
4133
@GetMapping("/test/invalid/response-400")
4234
public void badRequest(HttpServletResponse response) throws IOException {
4335
response.sendError(HttpServletResponse.SC_BAD_REQUEST);

src/test/robotframework/series/add-image/validation.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Add image with URL to a file that does not exist
4040
Element Text Should Be id=image-url.errors File not found
4141

4242
Add image with URL that causes a redirect
43-
Input Text id=image-url ${SITE_URL}/test/invalid/response-301
43+
Input Text id=image-url ${MOCK_SERVER}/series/response-301
4444
Submit Form id=add-image-form
4545
Element Text Should Be id=image-url.errors URL must not redirect to another address
4646

src/test/robotframework/series/creation/validation-admin.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Create series with image URL to a file that does not exist
5757
Element Text Should Be id=image-url.errors File not found
5858

5959
Create series with image URL that causes a redirect
60-
Input Text id=image-url ${SITE_URL}/test/invalid/response-301
60+
Input Text id=image-url ${MOCK_SERVER}/series/response-301
6161
Submit Form id=add-series-form
6262
Element Text Should Be id=image-url.errors URL must not redirect to another address
6363

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"request": {
3+
"method": "GET",
4+
"url": "/series/response-301"
5+
},
6+
"response": {
7+
"status": 301,
8+
"headers": {
9+
"Location": "http://127.0.0.1:8080"
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)