File tree Expand file tree Collapse file tree 4 files changed +14
-10
lines changed
main/java/ru/mystamps/web/controller Expand file tree Collapse file tree 4 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 2525import org .springframework .web .bind .annotation .GetMapping ;
2626import org .springframework .web .bind .annotation .ResponseBody ;
2727
28- import ru .mystamps .web .Url ;
29-
3028import static ru .mystamps .web .util .ControllerUtils .printHtml ;
3129
3230@ Controller
3331public 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 );
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
4040 Element Text Should Be id=image-url.errors File not found
4141
4242Add 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
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
5757 Element Text Should Be id=image-url.errors File not found
5858
5959Create 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
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