Skip to content

Commit f8be777

Browse files
committed
/test/invalid/empty-jpeg-file: port to using WireMock stub.
No functional changes.
1 parent 93130b4 commit f8be777

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@
3030
@Controller
3131
public class TestController {
3232

33-
@GetMapping("/test/invalid/empty-jpeg-file")
34-
public void emptyJpegFile(HttpServletResponse response) {
35-
response.setContentType("image/jpeg");
36-
response.setContentLength(0);
37-
}
38-
3933
@GetMapping(path = "/test/invalid/not-image-file", produces = "application/json")
4034
@ResponseBody
4135
public String simpleJson() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Add image with URL that causes a redirect
4545
Element Text Should Be id=image-url.errors URL must not redirect to another address
4646

4747
Add image with URL to an empty file
48-
Input Text id=image-url ${SITE_URL}/test/invalid/empty-jpeg-file
48+
Input Text id=image-url ${MOCK_SERVER}/series/empty-jpeg-file
4949
Submit Form id=add-image-form
5050
Element Text Should Be id=image-url.errors File must not be empty
5151

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Create series with image URL that causes a redirect
6262
Element Text Should Be id=image-url.errors URL must not redirect to another address
6363

6464
Create series with image URL to an empty file
65-
Input Text id=image-url ${SITE_URL}/test/invalid/empty-jpeg-file
65+
Input Text id=image-url ${MOCK_SERVER}/series/empty-jpeg-file
6666
Submit Form id=add-series-form
6767
Element Text Should Be id=image-url.errors File must not be empty
6868

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"request": {
3+
"method": "GET",
4+
"url": "/series/empty-jpeg-file"
5+
},
6+
"response": {
7+
"status": 200,
8+
"headers": {
9+
"Content-Type": "image/jpeg",
10+
"Content-Length": "0"
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)