Skip to content

Commit 7c79d57

Browse files
authored
FACT-2003 - updates azure storage blob version (#3363)
* - updates azure-storage-blob * - updates building azurite image with skipping azure storage blob version * - removes unneeded docker compose file * - updates test to reflect new version of azure * - updates test to reflect new version of azure * - updates test to reflect new version of azure
1 parent 6cc5fb3 commit 7c79d57

File tree

13 files changed

+21
-20
lines changed

13 files changed

+21
-20
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ dependencies {
276276
implementation group: 'net.javacrumbs.shedlock', name: 'shedlock-spring', version: '5.14.0'
277277
implementation group: 'net.javacrumbs.shedlock', name: 'shedlock-provider-jdbc', version: '5.14.0'
278278

279-
implementation group: 'com.azure', name: 'azure-storage-blob', version: '12.25.4'
279+
implementation group: 'com.azure', name: 'azure-storage-blob', version: '12.28.1'
280280

281281
implementation group: 'com.azure', name: 'azure-messaging-servicebus', version: '7.17.5'
282282

src/functionalTest/java/uk/gov/hmcts/reform/bulkscanprocessor/controllers/GetSasTokenTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private void verifySasTokenProperties(Response tokenResponse) throws java.io.IOE
137137
Date tokenExpiry = DateUtil.parseDatetime(queryParams.get("se"));
138138
assertThat(tokenExpiry).isNotNull();
139139
assertThat(queryParams.get("sig")).isNotNull(); //this is a generated hash of the resource string
140-
assertThat(queryParams.get("sv")).contains("2023-11-03"); //azure api version is latest
140+
assertThat(queryParams.get("sv")).contains("2024-11-04"); //azure api version is latest
141141
assertThat(queryParams.get("sp")).contains("wl"); //access permissions(write-w,list-l)
142142
}
143143

src/integrationTest/java/uk/gov/hmcts/reform/bulkscanprocessor/controllers/EnvelopeControllerTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ public class EnvelopeControllerTest {
114114
private BlobContainerClient testContainer;
115115

116116
private static GenericContainer<?> dockerComposeContainer =
117-
new GenericContainer<>(AZURE_TEST_CONTAINER).withExposedPorts(CONTAINER_PORT);
117+
new GenericContainer<>(AZURE_TEST_CONTAINER).withExposedPorts(CONTAINER_PORT)
118+
.withCommand("azurite-blob --blobHost 0.0.0.0 --blobPort 10000 --skipApiVersionCheck");
118119

119120
private static String dockerHost;
120121

src/integrationTest/java/uk/gov/hmcts/reform/bulkscanprocessor/controllers/SasTokenControllerTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private void verifySasTokenProperties(String tokenResponse) throws java.io.IOExc
6767

6868
assertThat(queryParams.get("sig")).isNotNull();//this is a generated hash of the resource string
6969
assertThat(queryParams.get("se")).startsWith(currentDate);//the expiry date/time for the signature
70-
assertThat(queryParams.get("sv")).contains("2023-11-03");//azure api version is latest
70+
assertThat(queryParams.get("sv")).contains("2024-11-04");//azure api version is latest
7171
assertThat(queryParams.get("sp")).contains("wl");//access permissions(write-w,list-l)
7272
}
7373
}

src/integrationTest/java/uk/gov/hmcts/reform/bulkscanprocessor/controllers/ZipStatusControllerTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ class ZipStatusControllerTest {
105105

106106

107107
private static GenericContainer<?> dockerComposeContainer =
108-
new GenericContainer<>(AZURE_TEST_CONTAINER).withExposedPorts(CONTAINER_PORT);
108+
new GenericContainer<>(AZURE_TEST_CONTAINER).withExposedPorts(CONTAINER_PORT)
109+
.withCommand("azurite-blob --blobHost 0.0.0.0 --blobPort 10000 --skipApiVersionCheck");
109110

110111
private static String dockerHost;
111112

src/integrationTest/java/uk/gov/hmcts/reform/bulkscanprocessor/services/reports/RejectedFilesReportServiceTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public class RejectedFilesReportServiceTest {
3131
private BlobManager blobManager;
3232

3333
private static GenericContainer<?> dockerComposeContainer =
34-
new GenericContainer<>(AZURE_TEST_CONTAINER).withExposedPorts(CONTAINER_PORT);
34+
new GenericContainer<>(AZURE_TEST_CONTAINER).withExposedPorts(CONTAINER_PORT)
35+
.withCommand("azurite-blob --blobHost 0.0.0.0 --blobPort 10000 --skipApiVersionCheck");
3536

3637
private static String dockerHost;
3738

src/integrationTest/java/uk/gov/hmcts/reform/bulkscanprocessor/services/storage/OcrValidationRetryManagerTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ class OcrValidationRetryManagerTest {
3434
private OcrValidationRetryManager ocrValidationRetryManager;
3535

3636
private static GenericContainer<?> dockerComposeContainer =
37-
new GenericContainer<>(AZURE_TEST_CONTAINER).withExposedPorts(CONTAINER_PORT);
37+
new GenericContainer<>(AZURE_TEST_CONTAINER).withExposedPorts(CONTAINER_PORT)
38+
.withCommand("azurite-blob --blobHost 0.0.0.0 --blobPort 10000 --skipApiVersionCheck");
3839

3940
private static String dockerHost;
4041

src/integrationTest/java/uk/gov/hmcts/reform/bulkscanprocessor/tasks/CleanUpRejectedFilesTaskTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public class CleanUpRejectedFilesTaskTest {
4747
private BlobManager blobManager;
4848

4949
private static GenericContainer<?> dockerComposeContainer =
50-
new GenericContainer<>(AZURE_TEST_CONTAINER).withExposedPorts(CONTAINER_PORT);
50+
new GenericContainer<>(AZURE_TEST_CONTAINER).withExposedPorts(CONTAINER_PORT)
51+
.withCommand("azurite-blob --blobHost 0.0.0.0 --blobPort 10000 --skipApiVersionCheck");
5152

5253
private static String dockerHost;
5354

src/integrationTest/java/uk/gov/hmcts/reform/bulkscanprocessor/tasks/ProcessorTestSuite.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ public abstract class ProcessorTestSuite {
127127
protected BlobContainerClient rejectedContainer;
128128

129129
private static GenericContainer<?> dockerComposeContainer =
130-
new GenericContainer<>(AZURE_TEST_CONTAINER).withExposedPorts(CONTAINER_PORT);
130+
new GenericContainer<>(AZURE_TEST_CONTAINER).withExposedPorts(CONTAINER_PORT)
131+
.withCommand("azurite-blob --blobHost 0.0.0.0 --blobPort 10000 --skipApiVersionCheck");
131132

132133
private static String dockerHost;
133134

src/integrationTest/java/uk/gov/hmcts/reform/bulkscanprocessor/util/TestStorageHelper.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ public class TestStorageHelper {
2626
private BlobContainerClient testContainer;
2727

2828
private static GenericContainer<?> DOCKER_COMPOSE_CONTAINER =
29-
new GenericContainer<>(AZURE_TEST_CONTAINER).withExposedPorts(CONTAINER_PORT);
29+
new GenericContainer<>(AZURE_TEST_CONTAINER).withExposedPorts(CONTAINER_PORT)
30+
.withCommand("azurite-blob --blobHost 0.0.0.0 --blobPort 10000 --skipApiVersionCheck");
3031

3132
private TestStorageHelper() {
3233
// empty constructor

src/integrationTest/resources/docker-compose.yml

-8
This file was deleted.

src/test/java/uk/gov/hmcts/reform/bulkscanprocessor/services/SasTokenGeneratorServiceTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void should_generate_sas_token_when_service_configuration_is_available() {
6060

6161
assertThat(queryParams.get("sig")).isNotNull();//this is a generated hash of the resource string
6262
assertThat(queryParams.get("se")).startsWith(currentDate);//the expiry date/time for the signature
63-
assertThat(queryParams.get("sv")).contains("2023-11-03");//azure api version is latest
63+
assertThat(queryParams.get("sv")).contains("2024-11-04");//azure api version is latest
6464
assertThat(queryParams.get("sp")).contains("rwl");//access permissions(write-w,list-l)
6565
}
6666

src/test/java/uk/gov/hmcts/reform/bulkscanprocessor/tasks/processor/BlobManagerTest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package uk.gov.hmcts.reform.bulkscanprocessor.tasks.processor;
22

3+
import com.azure.core.http.HttpHeaderName;
34
import com.azure.core.http.HttpHeaders;
45
import com.azure.core.http.HttpResponse;
56
import com.azure.core.http.rest.PagedIterable;
@@ -201,7 +202,8 @@ void tryMoveFileToRejectedContainer_retry_delete_when_lease_lost() {
201202
given(response.getStatusCode()).willReturn(412);
202203
HttpHeaders httpHeaders = mock(HttpHeaders.class);
203204
given(response.getHeaders()).willReturn(httpHeaders);
204-
given(httpHeaders.getValue(ERROR_CODE)).willReturn(BlobErrorCode.LEASE_LOST.toString());
205+
given(httpHeaders.getValue(HttpHeaderName.fromString(ERROR_CODE)))
206+
.willReturn(String.valueOf(BlobErrorCode.LEASE_LOST));
205207

206208

207209
willThrow(new BlobStorageException(BlobErrorCode.LEASE_LOST.toString(), response, null))

0 commit comments

Comments
 (0)