Skip to content

Commit eeb1127

Browse files
committed
rm COULD_NOT_CONNECT
1 parent db0c598 commit eeb1127

File tree

5 files changed

+2
-11
lines changed

5 files changed

+2
-11
lines changed

src/main/java/ru/mystamps/web/service/HttpURLConnectionDownloaderService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public DownloadResult download(String fileUrl) {
6969

7070
Code connectionResult = connect(conn);
7171
if (connectionResult != Code.SUCCESS) {
72-
return connectionResult;
72+
return DownloadResult.failed(connectionResult);
7373
}
7474

7575
try (InputStream stream = new BufferedInputStream(conn.getInputStream())) {
@@ -153,7 +153,7 @@ private static Code connect(HttpURLConnection conn) {
153153
"Couldn't download file: connect has failed with error '{}'",
154154
ex.getMessage()
155155
);
156-
return Code.COULD_NOT_CONNECT;
156+
return Code.UNEXPECTED_ERROR;
157157
}
158158
}
159159

src/main/java/ru/mystamps/web/service/dto/DownloadResult.java

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public enum Code {
4747
SUCCESS,
4848
INVALID_URL,
4949
INVALID_PROTOCOL,
50-
COULD_NOT_CONNECT,
5150
INVALID_REDIRECT,
5251
INVALID_FILE_TYPE,
5352
INVALID_FILE_SIZE,

src/main/resources/ru/mystamps/i18n/ValidationMessages.properties

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ ru.mystamps.web.validation.jsr303.RequireImageOrImageUrl.message = Image or imag
2727

2828
ru.mystamps.web.service.dto.DownloadResult.INVALID_URL = Invalid URL
2929
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
3130
ru.mystamps.web.service.dto.DownloadResult.INVALID_REDIRECT = URL must not redirect to another address
3231
ru.mystamps.web.service.dto.DownloadResult.INVALID_FILE_TYPE = Invalid file type
3332
ru.mystamps.web.service.dto.DownloadResult.INVALID_FILE_SIZE = Invalid file size

src/main/resources/ru/mystamps/i18n/ValidationMessages_ru.properties

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ ru.mystamps.web.validation.jsr303.RequireImageOrImageUrl.message = Необхо
2727

2828
ru.mystamps.web.service.dto.DownloadResult.INVALID_URL = Неправильный URL
2929
ru.mystamps.web.service.dto.DownloadResult.INVALID_PROTOCOL = Недопустимый протокол в URL
30-
ru.mystamps.web.service.dto.DownloadResult.COULD_NOT_CONNECT = Не удалось подключиться к серверу
3130
ru.mystamps.web.service.dto.DownloadResult.INVALID_REDIRECT = URL не должен перенаправлять на другой адрес
3231
ru.mystamps.web.service.dto.DownloadResult.INVALID_FILE_TYPE = Недопустимый тип файла
3332
ru.mystamps.web.service.dto.DownloadResult.INVALID_FILE_SIZE = Недопустимый размер файла

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

-6
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ Create series with unsupported protocol in the image URL
4444
Submit Form id=add-series-form
4545
Element Text Should Be id=image-url.errors Value must be a valid URL
4646

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-
5347
Create series with image URL with invalid response
5448
[Documentation] Verify validation of invalid response from a server
5549
Input Text id=image-url ${SITE_URL}/test/invalid/response-400

0 commit comments

Comments
 (0)