File tree 4 files changed +14
-10
lines changed
main/java/ru/mystamps/web/controller 4 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 25
25
import org .springframework .web .bind .annotation .GetMapping ;
26
26
import org .springframework .web .bind .annotation .ResponseBody ;
27
27
28
- import ru .mystamps .web .Url ;
29
-
30
28
import static ru .mystamps .web .util .ControllerUtils .printHtml ;
31
29
32
30
@ Controller
33
31
public class TestController {
34
32
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
-
41
33
@ GetMapping ("/test/invalid/response-400" )
42
34
public void badRequest (HttpServletResponse response ) throws IOException {
43
35
response .sendError (HttpServletResponse .SC_BAD_REQUEST );
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ Add image with URL to a file that does not exist
40
40
Element Text Should Be id=image-url.errors File not found
41
41
42
42
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
44
44
Submit Form id=add-image-form
45
45
Element Text Should Be id=image-url.errors URL must not redirect to another address
46
46
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ Create series with image URL to a file that does not exist
57
57
Element Text Should Be id=image-url.errors File not found
58
58
59
59
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
61
61
Submit Form id=add-series-form
62
62
Element Text Should Be id=image-url.errors URL must not redirect to another address
63
63
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments