Skip to content

Commit dc4b36f

Browse files
committed
Fix compile.
1 parent 835b9ff commit dc4b36f

File tree

8 files changed

+52
-33
lines changed

8 files changed

+52
-33
lines changed

admin-cli/pom.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,12 @@
120120
<artifactId>katta-clientlib-hub</artifactId>
121121
<version>${project.version}</version>
122122
<classifier>tests</classifier>
123-
<type>test-jar</type>
123+
<type>jar</type>
124124
<overWrite>false</overWrite>
125125
<outputDirectory>${project.build.directory}/test-classes</outputDirectory>
126126
<includes>**/*</includes>
127127
</artifactItem>
128128
</artifactItems>
129-
<includes>**/*.java</includes>
130-
<excludes>**/*.properties</excludes>
131-
<outputDirectory>${project.build.directory}/wars</outputDirectory>
132-
<overWriteReleases>false</overWriteReleases>
133-
<overWriteSnapshots>true</overWriteSnapshots>
134129
</configuration>
135130
</execution>
136131
</executions>

admin-cli/src/main/java/cloud/katta/cli/commands/hub/StorageProfileAwsStaticSetup.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import cloud.katta.client.api.StorageProfileResourceApi;
1212
import cloud.katta.client.model.Protocol;
1313
import cloud.katta.client.model.S3STORAGECLASSES;
14-
import cloud.katta.client.model.StorageProfileS3Dto;
14+
import cloud.katta.client.model.StorageProfileS3StaticDto;
1515
import picocli.CommandLine;
1616

1717
/**
@@ -33,10 +33,10 @@ protected void call(final UUID uuid, final ApiClient apiClient) throws ApiExcept
3333
}
3434

3535
protected void call(UUID uuid, StorageProfileResourceApi storageProfileResourceApi) throws ApiException {
36-
storageProfileResourceApi.apiStorageprofileS3Put(new StorageProfileS3Dto()
36+
storageProfileResourceApi.apiStorageprofileS3staticPost(new StorageProfileS3StaticDto()
3737
.id(uuid)
3838
.name("AWS S3 static")
39-
.protocol(Protocol.S3)
39+
.protocol(Protocol.S3_STATIC)
4040
.storageClass(S3STORAGECLASSES.STANDARD)
4141
.archived(false)
4242
.scheme("https")

admin-cli/src/main/java/cloud/katta/cli/commands/hub/StorageProfileAwsStsSetup.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected void call(final UUID uuid, final ApiClient apiClient) throws ApiExcept
4242
}
4343

4444
protected void call(UUID uuid, StorageProfileResourceApi storageProfileResourceApi) throws ApiException {
45-
storageProfileResourceApi.apiStorageprofileS3stsPut(new StorageProfileS3STSDto()
45+
storageProfileResourceApi.apiStorageprofileS3stsPost(new StorageProfileS3STSDto()
4646
.id(uuid)
4747
.name("AWS S3 STS")
4848
.bucketPrefix(bucketPrefix)
@@ -55,12 +55,12 @@ protected void call(UUID uuid, StorageProfileResourceApi storageProfileResourceA
5555
.archived(false)
5656
.bucketEncryption(S3SERVERSIDEENCRYPTION.NONE)
5757
// arn:aws:iam::XXXXXXX:role/testing.katta.cloud-kc-realms-tamarind-sts-chain-01
58-
.stsRoleArn(String.format("%s-sts-chain-01", rolePrefix))
58+
.stsRoleAccessBucketAssumeRoleWithWebIdentity(String.format("%s-sts-chain-01", rolePrefix))
5959
// arn:aws:iam::XXXXXXX:role/testing.katta.cloud-kc-realms-tamarind-sts-chain-02
60-
.stsRoleArn2(String.format("%s-sts-chain-02", rolePrefix))
60+
.stsRoleAccessBucketAssumeRoleTaggedSession(String.format("%s-sts-chain-02", rolePrefix))
6161
// arn:aws:iam::XXXXXXX:role/testing.katta.cloud-kc-realms-tamarind-createbucket
62-
.stsRoleArnClient(String.format("%s-createbucket", rolePrefix))
63-
.stsRoleArnHub(String.format("%s-createbucket", rolePrefix))
62+
.stsRoleCreateBucketClient(String.format("%s-createbucket", rolePrefix))
63+
.stsRoleCreateBucketHub(String.format("%s-createbucket", rolePrefix))
6464
.scheme("https")
6565
.port(443)
6666
);

admin-cli/src/test/java/cloud/katta/cli/commands/hub/StorageProfileArchiveIT.java

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@
99

1010
import org.junit.jupiter.api.Test;
1111

12+
import java.util.Arrays;
1213
import java.util.Optional;
14+
import java.util.UUID;
1315

1416
import cloud.katta.client.api.StorageProfileResourceApi;
15-
import cloud.katta.client.model.StorageProfileS3Dto;
17+
import cloud.katta.client.model.Protocol;
18+
import cloud.katta.client.model.S3SERVERSIDEENCRYPTION;
19+
import cloud.katta.client.model.S3STORAGECLASSES;
20+
import cloud.katta.client.model.StorageProfileDto;
21+
import cloud.katta.client.model.StorageProfileS3StaticDto;
22+
import cloud.katta.model.StorageProfileDtoWrapper;
1623
import cloud.katta.testcontainers.AbtractAdminCliIT;
1724

1825
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -26,13 +33,30 @@ public void testStorageProfileArchive() throws Exception {
2633
final String storageProfileId = "732D43FA-3716-46C4-B931-66EA5405EF1C".toLowerCase();
2734
final StorageProfileResourceApi storageProfileResourceApi = new StorageProfileResourceApi(hubSession.getClient());
2835
{
29-
final Optional<StorageProfileS3Dto> profile = storageProfileResourceApi.apiStorageprofileS3Get().stream().filter(p -> p.getId().toString().toLowerCase().equals(storageProfileId)).findFirst();
36+
storageProfileResourceApi.apiStorageprofileS3staticPost(new StorageProfileS3StaticDto()
37+
.id(UUID.fromString(storageProfileId))
38+
.name("S3 static")
39+
.protocol(Protocol.S3_STATIC)
40+
.archived(false)
41+
.storageClass(S3STORAGECLASSES.STANDARD)
42+
.region("eu-west-1")
43+
.regions(Arrays.asList("eu-west-1"))
44+
.bucketPrefix("katta-test")
45+
.stsRoleCreateBucketClient("")
46+
.stsRoleCreateBucketHub("")
47+
.bucketVersioning(true)
48+
.bucketEncryption(S3SERVERSIDEENCRYPTION.NONE)
49+
);
50+
51+
final Optional<StorageProfileS3StaticDto> profile = storageProfileResourceApi.apiStorageprofileGet(null).stream().filter(p -> StorageProfileDtoWrapper.coerce(p).getId().toString().toLowerCase().equals(storageProfileId))
52+
.map(StorageProfileDto::getActualInstance).map(StorageProfileS3StaticDto.class::cast)
53+
.findFirst();
3054
assertTrue(profile.isPresent());
3155
assertFalse(profile.get().getArchived());
3256
}
3357
new StorageProfileArchive().call("http://localhost:8280", accessToken, storageProfileId);
3458
{
35-
final Optional<StorageProfileS3Dto> profile = storageProfileResourceApi.apiStorageprofileS3Get().stream().filter(p -> p.getId().toString().toLowerCase().equals(storageProfileId)).findFirst();
59+
final Optional<StorageProfileS3StaticDto> profile = storageProfileResourceApi.apiStorageprofileGet(null).stream().filter(p -> StorageProfileDtoWrapper.coerce(p).getId().toString().toLowerCase().equals(storageProfileId)).map(StorageProfileDto::getActualInstance).map(StorageProfileS3StaticDto.class::cast).findFirst();
3660
assertTrue(profile.isPresent());
3761
assertTrue(profile.get().getArchived());
3862
}

admin-cli/src/test/java/cloud/katta/cli/commands/hub/StorageProfileAwsStaticSetupTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import cloud.katta.client.api.StorageProfileResourceApi;
1414
import cloud.katta.client.model.Protocol;
1515
import cloud.katta.client.model.S3STORAGECLASSES;
16-
import cloud.katta.client.model.StorageProfileS3Dto;
16+
import cloud.katta.client.model.StorageProfileS3StaticDto;
1717

1818
import static org.mockito.ArgumentMatchers.any;
1919
import static org.mockito.Mockito.times;
@@ -26,16 +26,16 @@ public void testCall() throws ApiException {
2626
final StorageProfileAwsStaticSetup cli = new StorageProfileAwsStaticSetup();
2727
cli.call(vaultId, api);
2828

29-
final StorageProfileS3Dto dto = new StorageProfileS3Dto();
29+
final StorageProfileS3StaticDto dto = new StorageProfileS3StaticDto();
3030
dto.setId(vaultId);
3131
dto.setName("AWS S3 static");
32-
dto.setProtocol(Protocol.S3);
32+
dto.setProtocol(Protocol.S3_STATIC);
3333
dto.setArchived(false);
3434
dto.setScheme("https");
3535
dto.setPort(443);
3636
dto.setWithPathStyleAccessEnabled(false);
3737
dto.setStorageClass(S3STORAGECLASSES.STANDARD);
38-
Mockito.verify(api, times(1)).apiStorageprofileS3Put(dto);
39-
Mockito.verify(api, times(1)).apiStorageprofileS3Put(any());
38+
Mockito.verify(api, times(1)).apiStorageprofileS3staticPost(dto);
39+
Mockito.verify(api, times(1)).apiStorageprofileS3staticPost(any());
4040
}
4141
}

admin-cli/src/test/java/cloud/katta/cli/commands/hub/StorageProfileAwsStsSetupIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ public void testStorageProfileAwsStsSetup() throws Exception {
5757
assertEquals(Arrays.asList("eu-west-1", "eu-west-2", "eu-west-3"), dto.getRegions());
5858
assertEquals("katta", dto.getBucketPrefix());
5959
assertEquals("katta", dto.getBucketPrefix());
60-
assertEquals("arn:aws:iam::linguine:role/farfalle-createbucket", dto.getStsRoleArnClient());
61-
assertEquals("arn:aws:iam::linguine:role/farfalle-createbucket", dto.getStsRoleArnHub());
60+
assertEquals("arn:aws:iam::linguine:role/farfalle-createbucket", dto.getStsRoleCreateBucketClient());
61+
assertEquals("arn:aws:iam::linguine:role/farfalle-createbucket", dto.getStsRoleCreateBucketHub());
6262
assertNull(dto.getStsEndpoint());
6363
assertTrue(dto.getBucketVersioning());
6464
assertNull(dto.getBucketAcceleration());
6565
assertEquals(S3SERVERSIDEENCRYPTION.NONE, dto.getBucketEncryption());
66-
assertEquals("arn:aws:iam::linguine:role/farfalle-sts-chain-01", dto.getStsRoleArn());
67-
assertEquals("arn:aws:iam::linguine:role/farfalle-sts-chain-02", dto.getStsRoleArn2());
66+
assertEquals("arn:aws:iam::linguine:role/farfalle-sts-chain-01", dto.getStsRoleAccessBucketAssumeRoleWithWebIdentity());
67+
assertEquals("arn:aws:iam::linguine:role/farfalle-sts-chain-02", dto.getStsRoleAccessBucketAssumeRoleTaggedSession());
6868
assertNull(dto.getStsDurationSeconds());
6969
}
7070
}

admin-cli/src/test/java/cloud/katta/cli/commands/hub/StorageProfileAwsStsSetupTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public void testCall() throws ApiException {
4242
dto.setRegion("eu-west-1");
4343
dto.setRegions(Arrays.asList("eu-west-1", "eu-west-2", "eu-west-3"));
4444
dto.bucketPrefix("fancy");
45-
dto.stsRoleArnClient("arn:aws:iam::1234:role/testing.katta.cloud-kc-realms-pepper-createbucket");
46-
dto.stsRoleArnHub("arn:aws:iam::1234:role/testing.katta.cloud-kc-realms-pepper-createbucket");
45+
dto.stsRoleCreateBucketClient("arn:aws:iam::1234:role/testing.katta.cloud-kc-realms-pepper-createbucket");
46+
dto.stsRoleCreateBucketHub("arn:aws:iam::1234:role/testing.katta.cloud-kc-realms-pepper-createbucket");
4747
dto.setBucketEncryption(S3SERVERSIDEENCRYPTION.NONE);
48-
dto.stsRoleArn("arn:aws:iam::1234:role/testing.katta.cloud-kc-realms-pepper-sts-chain-01");
49-
dto.stsRoleArn2("arn:aws:iam::1234:role/testing.katta.cloud-kc-realms-pepper-sts-chain-02");
50-
Mockito.verify(api, times(1)).apiStorageprofileS3stsPut(dto);
51-
Mockito.verify(api, times(1)).apiStorageprofileS3stsPut(any());
48+
dto.stsRoleAccessBucketAssumeRoleWithWebIdentity("arn:aws:iam::1234:role/testing.katta.cloud-kc-realms-pepper-sts-chain-01");
49+
dto.stsRoleAccessBucketAssumeRoleTaggedSession("arn:aws:iam::1234:role/testing.katta.cloud-kc-realms-pepper-sts-chain-02");
50+
Mockito.verify(api, times(1)).apiStorageprofileS3stsPost(dto);
51+
Mockito.verify(api, times(1)).apiStorageprofileS3stsPost(any());
5252
}
5353
}

admin-cli/src/test/java/cloud/katta/testcontainers/AbtractAdminCliIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static void setupDocker() throws URISyntaxException, IOException {
5151
.withPull(true)
5252
.withEnv(env)
5353
.withOptions(configuration.profile == null ? "" : String.format("--profile=%s", configuration.profile))
54-
.waitingFor("wait-1", new LogMessageWaitStrategy().withRegEx(".*exit 0.*").withStartupTimeout(Duration.ofMinutes(2)));
54+
.waitingFor("minio_setup-1", new LogMessageWaitStrategy().withRegEx(".*Completed MinIO Setup.*").withStartupTimeout(Duration.ofMinutes(2)));
5555
compose.start();
5656

5757
log.info("Done setup docker {}", configuration);

0 commit comments

Comments
 (0)