File tree 5 files changed +2
-11
lines changed
java/ru/mystamps/web/service
resources/ru/mystamps/i18n
test/robotframework/series/creation
5 files changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ public DownloadResult download(String fileUrl) {
69
69
70
70
Code connectionResult = connect (conn );
71
71
if (connectionResult != Code .SUCCESS ) {
72
- return connectionResult ;
72
+ return DownloadResult . failed ( connectionResult ) ;
73
73
}
74
74
75
75
try (InputStream stream = new BufferedInputStream (conn .getInputStream ())) {
@@ -153,7 +153,7 @@ private static Code connect(HttpURLConnection conn) {
153
153
"Couldn't download file: connect has failed with error '{}'" ,
154
154
ex .getMessage ()
155
155
);
156
- return Code .COULD_NOT_CONNECT ;
156
+ return Code .UNEXPECTED_ERROR ;
157
157
}
158
158
}
159
159
Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ public enum Code {
47
47
SUCCESS ,
48
48
INVALID_URL ,
49
49
INVALID_PROTOCOL ,
50
- COULD_NOT_CONNECT ,
51
50
INVALID_REDIRECT ,
52
51
INVALID_FILE_TYPE ,
53
52
INVALID_FILE_SIZE ,
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ ru.mystamps.web.validation.jsr303.RequireImageOrImageUrl.message = Image or imag
27
27
28
28
ru.mystamps.web.service.dto.DownloadResult.INVALID_URL = Invalid URL
29
29
ru.mystamps.web.service.dto.DownloadResult.INVALID_PROTOCOL = Invalid protocol in the URL
30
- ru.mystamps.web.service.dto.DownloadResult.COULD_NOT_CONNECT = Could not connect to the server
31
30
ru.mystamps.web.service.dto.DownloadResult.INVALID_REDIRECT = URL must not redirect to another address
32
31
ru.mystamps.web.service.dto.DownloadResult.INVALID_FILE_TYPE = Invalid file type
33
32
ru.mystamps.web.service.dto.DownloadResult.INVALID_FILE_SIZE = Invalid file size
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ ru.mystamps.web.validation.jsr303.RequireImageOrImageUrl.message = Необхо
27
27
28
28
ru.mystamps.web.service.dto.DownloadResult.INVALID_URL = Неправильный URL
29
29
ru.mystamps.web.service.dto.DownloadResult.INVALID_PROTOCOL = Недопустимый протокол в URL
30
- ru.mystamps.web.service.dto.DownloadResult.COULD_NOT_CONNECT = Не удалось подключиться к серверу
31
30
ru.mystamps.web.service.dto.DownloadResult.INVALID_REDIRECT = URL не должен перенаправлять на другой адрес
32
31
ru.mystamps.web.service.dto.DownloadResult.INVALID_FILE_TYPE = Недопустимый тип файла
33
32
ru.mystamps.web.service.dto.DownloadResult.INVALID_FILE_SIZE = Недопустимый размер файла
Original file line number Diff line number Diff line change @@ -44,12 +44,6 @@ Create series with unsupported protocol in the image URL
44
44
Submit Form id=add-series-form
45
45
Element Text Should Be id=image-url.errors Value must be a valid URL
46
46
47
- Create series with unavailable server in the image URL
48
- [Documentation] Verify validation of URL to an unavailable server
49
- Input Text id=image-url http://127.0.0.1:9999/not-existing-host
50
- Submit Form id=add-series-form
51
- Element Text Should Be id=image-url.errors Could not connect to the server
52
-
53
47
Create series with image URL with invalid response
54
48
[Documentation] Verify validation of invalid response from a server
55
49
Input Text id=image-url ${SITE_URL } /test/invalid/response-400
You can’t perform that action at this time.
0 commit comments