Skip to content

Commit ee25d80

Browse files
committed
/test/invalid/not-image-file: port to using WireMock stub.
No functional changes.
1 parent f8be777 commit ee25d80

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,12 @@
2323

2424
import org.springframework.stereotype.Controller;
2525
import org.springframework.web.bind.annotation.GetMapping;
26-
import org.springframework.web.bind.annotation.ResponseBody;
2726

2827
import static ru.mystamps.web.util.ControllerUtils.printHtml;
2928

3029
@Controller
3130
public class TestController {
3231

33-
@GetMapping(path = "/test/invalid/not-image-file", produces = "application/json")
34-
@ResponseBody
35-
public String simpleJson() {
36-
return "test";
37-
}
38-
3932
@GetMapping("/test/valid/series-info/existing-seller")
4033
public void seriesInfoWithExistingSeller(HttpServletResponse response) throws IOException {
4134
printHtml(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Add image with URL to an empty file
5050
Element Text Should Be id=image-url.errors File must not be empty
5151

5252
Add image with URL to a file of unsupported type (not an image)
53-
Input Text id=image-url ${SITE_URL}/test/invalid/not-image-file
53+
Input Text id=image-url ${MOCK_SERVER}/series/not-image-file
5454
Submit Form id=add-image-form
5555
Element Text Should Be id=image-url.errors Invalid file type
5656

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Create series with image URL to an empty file
6767
Element Text Should Be id=image-url.errors File must not be empty
6868

6969
Create series with image URL to a file of unsupported type (not an image)
70-
Input Text id=image-url ${SITE_URL}/test/invalid/not-image-file
70+
Input Text id=image-url ${MOCK_SERVER}/series/not-image-file
7171
Submit Form id=add-series-form
7272
Element Text Should Be id=image-url.errors Invalid file type
7373

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/not-image-file"
5+
},
6+
"response": {
7+
"status": 200,
8+
"headers": {
9+
"Content-Type": "application/json"
10+
},
11+
"jsonBody": "test"
12+
}
13+
}

0 commit comments

Comments
 (0)