Skip to content

Commit 19ed35d

Browse files
committed
Make final.
1 parent 0f4829e commit 19ed35d

File tree

11 files changed

+31
-32
lines changed

11 files changed

+31
-32
lines changed

hub/src/test/java/ch/iterate/hub/client/model/ObjectMapperTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void testMinioStatic() throws IOException {
7979
public void testMinioSTS() throws IOException {
8080
final ObjectMapper mapper = new ObjectMapper();
8181
mapper.registerModule(new JsonNullableModule());
82-
StorageProfileS3STSDto minioSTSProfile = mapper.readValue(this.getClass().getResourceAsStream("/setup/minio_sts/minio_sts_profile.json"), StorageProfileS3STSDto.class);
82+
final StorageProfileS3STSDto minioSTSProfile = mapper.readValue(this.getClass().getResourceAsStream("/setup/minio_sts/minio_sts_profile.json"), StorageProfileS3STSDto.class);
8383
assertEquals("cipherduck", minioSTSProfile.getBucketPrefix());
8484
assertEquals("eu-central-1", minioSTSProfile.getRegion());
8585
assertEquals(Arrays.asList("eu-west-1", "eu-west-2", "eu-west-3", "eu-north-1", "eu-south-1", "eu-south-2", "eu-central-1", "eu-central-2"), minioSTSProfile.getRegions());

hub/src/test/java/ch/iterate/hub/core/AbstractHubSynchronizeTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public void test01Bootstrapping(final HubTestConfig hubTestConfig) throws Except
140140
new HubStorageProfileSyncSchedulerService(hubSession).operate(new DisabledLoginCallback());
141141

142142
log.info(String.format("%s Protocols found:", ProtocolFactory.get().find().size()));
143-
for(Protocol protocol : ProtocolFactory.get().find()) {
143+
for(final Protocol protocol : ProtocolFactory.get().find()) {
144144
log.info(String.format("- %s", protocol));
145145
}
146146

@@ -247,17 +247,17 @@ public void test03AddVault(final HubTestConfig config) throws Exception {
247247
log.info(String.format("Listing bucket %s in %s", vaultBookmark.getDefaultPath(), vaultBookmark));
248248
final Date before = new Date();
249249
final Path bucket = new Path(vaultBookmark.getDefaultPath(), EnumSet.of(Path.Type.directory, Path.Type.volume));
250-
AttributedList<Path> bucketListRaw = session.getFeature(ListService.class).list(bucket, new DisabledListProgressListener());
250+
final AttributedList<Path> bucketListRaw = session.getFeature(ListService.class).list(bucket, new DisabledListProgressListener());
251251
final Date after = new Date();
252252

253253
log.info(before);
254254
log.info(after);
255255
log.info("paths:");
256256

257257
for(final Path path : bucketListRaw) {
258-
Date date = new Date();
258+
final Date date = new Date();
259259
date.setTime(path.attributes().getModificationDate());
260-
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEEE dd-MMM-yy HH:mm:ssZ");
260+
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEEE dd-MMM-yy HH:mm:ssZ");
261261
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("Europe/London"));
262262
log.info(String.format("%s %s [%s,%s]", path,
263263
simpleDateFormat.format(date),

hub/src/test/java/ch/iterate/hub/core/KeyRotationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void keyrotationTest(final HubTestConfig hubTestConfig) throws Exception
6666
.filter(u -> u.getEcdhPublicKey() != null)
6767
.collect(Collectors.toMap(UserDto::getId, UserDto::getEcdhPublicKey));
6868

69-
for(VaultDto vaultDto : vaults) {
69+
for(final VaultDto vaultDto : vaults) {
7070
final HashMap<String, String> tokens = new HashMap<>();
7171
final UserKeysService service = new UserKeysServiceImpl(hubSession);
7272
final UserKeys userKeys = service.getUserKeys(hubSession.getHost(), FirstLoginDeviceSetupCallback.disabled);
@@ -77,7 +77,7 @@ public void keyrotationTest(final HubTestConfig hubTestConfig) throws Exception
7777
// TODO https://github.com/shift7-ch/cipherduck-hub/issues/37 change nickname for now - could be used to rotate of shared access key/secret key.
7878
metadataJWE.storage().nickname(String.format("ZZZZ %s", vaultDto.getName()));
7979
final List<MemberDto> members = vaultResourceApi.apiVaultsVaultIdMembersGet(vaultDto.getId());
80-
for(MemberDto member : members) {
80+
for(final MemberDto member : members) {
8181
if(userPublicKeys.containsKey(member.getId())) {
8282
tokens.put(member.getId(), masterkeyJWE.encryptForUser(decodePublicKey(userPublicKeys.get(member.getId()))));
8383
}
@@ -89,4 +89,4 @@ public void keyrotationTest(final HubTestConfig hubTestConfig) throws Exception
8989
hubSession.close();
9090
}
9191
}
92-
}
92+
}

hub/src/test/java/ch/iterate/hub/core/util/UnsecureHostPasswordStorePatched.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import ch.cyberduck.core.Protocol;
1111
import ch.cyberduck.core.Scheme;
1212
import ch.cyberduck.core.UnsecureHostPasswordStore;
13-
import ch.cyberduck.core.exception.LocalAccessDeniedException;
1413

1514
import org.apache.commons.lang3.StringUtils;
1615
import org.apache.logging.log4j.LogManager;
@@ -69,7 +68,7 @@ public static Scheme getOAuthScheme(final Host bookmark) {
6968

7069
// copy-paste from DefaultHostPasswordStore to call patched getOAuthPrefix (as it is static)
7170
@Override
72-
public void save(final Host bookmark) throws LocalAccessDeniedException {
71+
public void save(final Host bookmark) {
7372
if(StringUtils.isEmpty(bookmark.getHostname())) {
7473
log.warn("No hostname given");
7574
return;
@@ -103,7 +102,7 @@ public void save(final Host bookmark) throws LocalAccessDeniedException {
103102
}
104103
if(credentials.isOAuthAuthentication()) {
105104
final String[] descriptors = getOAuthPrefix(bookmark);
106-
for(String prefix : descriptors) {
105+
for(final String prefix : descriptors) {
107106
if(StringUtils.isNotBlank(credentials.getOauth().getAccessToken())) {
108107
log.info(String.format("addPassword(%s,%s,%s)", getOAuthScheme(bookmark),
109108
getOAuthPort(bookmark), getOAuthHostname(bookmark),
@@ -141,7 +140,7 @@ public OAuthTokens findOAuthTokens(final Host bookmark) {
141140
log.info(String.format("XXX Fetching OAuth tokens from keychain for %s", bookmark));
142141
}
143142
final String[] descriptors = getOAuthPrefix(bookmark);
144-
for(String prefix : descriptors) {
143+
for(final String prefix : descriptors) {
145144
if(log.isDebugEnabled()) {
146145
log.debug(String.format("Search with prefix %s", prefix));
147146
}
@@ -191,7 +190,7 @@ public OAuthTokens findOAuthTokens(final Host bookmark) {
191190
}
192191

193192
@Override
194-
public void addPassword(String serviceName, String accountName, String password) {
193+
public void addPassword(final String serviceName, final String accountName, final String password) {
195194
log.info(String.format("XXX %s, %s, %s", serviceName, accountName, password));
196195
super.addPassword(serviceName, accountName, password);
197196
}

hub/src/test/java/ch/iterate/hub/crypto/uvf/UvfMetadataPayloadTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void recoveryKeyToOwnerAccessTokenAndBack() throws JOSEException, ParseEx
7777
public void encryptDecrypt() throws JOSEException, JsonProcessingException, ParseException {
7878
final byte[] rawMasterKey = new byte[32];
7979
FastSecureRandomProvider.get().provide().nextBytes(rawMasterKey);
80-
HashMap<String, String> keys = new HashMap<String, String>() {{
80+
final HashMap<String, String> keys = new HashMap<String, String>() {{
8181
put("key01", Base64URL.encode(UUID.randomUUID().toString().getBytes(StandardCharsets.UTF_8)).toString());
8282
put("key02", Base64URL.encode(UUID.randomUUID().toString().getBytes(StandardCharsets.UTF_8)).toString());
8383
}};
@@ -177,4 +177,4 @@ public void computeRootDirIdHash() throws ParseException, JOSEException, JsonPro
177177
final String hash = meta.computeRootDirIdHash(rootDirId);
178178
assertEquals("6DYU3E5BTPAZ4DWEQPQK3AIHX2DXSPHG", hash);
179179
}
180-
}
180+
}

hub/src/test/java/ch/iterate/hub/crypto/wot/WoTTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void verifyRecursiveAndComputeTrustLevelNotAllegedSignedKeys() throws ParseExcep
166166
@Test
167167
public void verifyTrusts() throws ParseException, JOSEException, NoSuchAlgorithmException, InvalidKeySpecException, NotECKeyException, SecurityFailure {
168168
final List<String> bobSignatureChain = new LinkedList<>();
169-
int len = 5;
169+
final int len = 5;
170170

171171
final UserKeys bobKeys = UserKeys.create();
172172
final UserDto bob = new UserDto()
@@ -205,4 +205,4 @@ public void verifyTrusts() throws ParseException, JOSEException, NoSuchAlgorithm
205205
final Map<TrustedUserDto, Integer> actual = WoT.verifyTrusts(Arrays.asList(bobTrust, oscarTrust), Arrays.asList(alice, bob, oscar), decodePublicKey(alice.getEcdsaPublicKey()));
206206
assertEquals(Collections.singletonMap(bobTrust, len), actual);
207207
}
208-
}
208+
}

hub/src/test/java/ch/iterate/hub/testsetup/HubTestSetupDockerExtension.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ public void afterAll(final ExtensionContext context) throws Exception {
6060

6161
public static class UnattendedLocalOnly extends HubTestSetupDockerExtension {
6262
@Override
63-
public void beforeAll(ExtensionContext context) throws URISyntaxException {
63+
public void beforeAll(final ExtensionContext context) throws URISyntaxException {
6464
this.setupDocker(UNATTENDED_LOCAL_ONLY.dockerConfig);
6565
}
6666
}
6767

6868
public static class UnattendedLocalKeycloakDev extends HubTestSetupDockerExtension {
6969
@Override
70-
public void beforeAll(ExtensionContext context) throws URISyntaxException {
70+
public void beforeAll(final ExtensionContext context) throws URISyntaxException {
7171
this.setupDocker(UNATTENDED_LOCAL_KEYCLOAK_TESTING.dockerConfig);
7272
}
7373
}

hub/src/test/java/ch/iterate/hub/testsetup/MethodIgnorableArgumentsProvider.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ public class MethodIgnorableArgumentsProvider implements ArgumentsProvider, Anno
2020
private String[] methodNames;
2121

2222
@Override
23-
public void accept(MethodIgnorableSource annotation) {
23+
public void accept(final MethodIgnorableSource annotation) {
2424
methodNames = annotation.value();
2525
}
2626

2727
@Override
28-
public Stream<Arguments> provideArguments(ExtensionContext context) {
29-
Class<?> testClass = context.getRequiredTestClass();
30-
Object testInstance = context.getTestInstance().orElse(null);
28+
public Stream<Arguments> provideArguments(final ExtensionContext context) {
29+
final Class<?> testClass = context.getRequiredTestClass();
30+
final Object testInstance = context.getTestInstance().orElse(null);
3131
return Arrays.stream(methodNames)
3232
.map(methodName -> ReflectionUtils.findMethod(testClass, methodName)
3333
.orElseThrow(() -> new JUnitException("Could not find method: " + methodName)))
@@ -36,7 +36,7 @@ public Stream<Arguments> provideArguments(ExtensionContext context) {
3636
.map(MethodIgnorableArgumentsProvider::toArguments);
3737
}
3838

39-
private static Arguments toArguments(Object item) {
39+
private static Arguments toArguments(final Object item) {
4040
if(item instanceof Arguments) {
4141
return (Arguments) item;
4242
}

hub/src/test/java/ch/iterate/hub/workflows/AbstractHubWorkflowTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void testHubWorkflow(final HubTestConfig config) throws Exception {
7575
log.info(String.format("S02 %s alice shares vault with admin as owner", setup));
7676
final List<UserDto> userDtos = new UsersResourceApi(hubSession.getClient()).apiUsersGet();
7777
String adminId = null;
78-
for(UserDto user : userDtos) {
78+
for(final UserDto user : userDtos) {
7979
if("admin".equals(user.getName())) {
8080
adminId = user.getId();
8181
break;

hub/src/test/java/ch/iterate/hub/workflows/VaultServiceImplTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void testGetVaultOwnerAccessTokenJWE() throws JOSEException, JsonProcessi
2929
final VaultService service = new VaultServiceImpl(vaultResourceMock);
3030

3131
final UserKeys userKeys = UserKeys.create();
32-
UvfMetadataPayload.UniversalVaultFormatJWKS jwks = UvfMetadataPayload.createKeys();
32+
final UvfMetadataPayload.UniversalVaultFormatJWKS jwks = UvfMetadataPayload.createKeys();
3333
final String accessToken = jwks.toOwnerAccessToken().encryptForUser(userKeys.ecdhKeyPair().getPublic());
3434

3535
final UUID vaultId = UUID.randomUUID();
@@ -46,7 +46,7 @@ public void testGetVaultAccessTokenJWE() throws JOSEException, JsonProcessingExc
4646
final VaultService service = new VaultServiceImpl(vaultResourceMock);
4747

4848
final UserKeys userKeys = UserKeys.create();
49-
UvfMetadataPayload.UniversalVaultFormatJWKS jwks = UvfMetadataPayload.createKeys();
49+
final UvfMetadataPayload.UniversalVaultFormatJWKS jwks = UvfMetadataPayload.createKeys();
5050
final String accessToken = jwks.toAccessToken().encryptForUser(userKeys.ecdhKeyPair().getPublic());
5151

5252
final UUID vaultId = UUID.randomUUID();
@@ -63,7 +63,7 @@ public void testGetVaultWrongAccessTokenJWE() throws JOSEException, JsonProcessi
6363
final VaultService service = new VaultServiceImpl(vaultResourceMock);
6464

6565
final UserKeys userKeys = UserKeys.create();
66-
UvfMetadataPayload.UniversalVaultFormatJWKS jwks = UvfMetadataPayload.createKeys();
66+
final UvfMetadataPayload.UniversalVaultFormatJWKS jwks = UvfMetadataPayload.createKeys();
6767
jwks.toAccessToken().encryptForUser(userKeys.ecdhKeyPair().getPublic());
6868

6969
final UUID vaultId = UUID.randomUUID();
@@ -79,7 +79,7 @@ public void testGetVaultMetadataJWE() throws JOSEException, JsonProcessingExcept
7979
final VaultService service = new VaultServiceImpl(vaultResourceMock);
8080

8181
final UserKeys userKeys = UserKeys.create();
82-
UvfMetadataPayload.UniversalVaultFormatJWKS jwks = UvfMetadataPayload.createKeys();
82+
final UvfMetadataPayload.UniversalVaultFormatJWKS jwks = UvfMetadataPayload.createKeys();
8383
final String accessToken = jwks.toAccessToken().encryptForUser(userKeys.ecdhKeyPair().getPublic());
8484

8585
final UUID vaultId = UUID.randomUUID();
@@ -104,7 +104,7 @@ public void testGetWrongVaultMetadataJWE() throws JOSEException, JsonProcessingE
104104
final VaultService service = new VaultServiceImpl(vaultResourceMock);
105105

106106
final UserKeys userKeys = UserKeys.create();
107-
UvfMetadataPayload.UniversalVaultFormatJWKS jwks = UvfMetadataPayload.createKeys();
107+
final UvfMetadataPayload.UniversalVaultFormatJWKS jwks = UvfMetadataPayload.createKeys();
108108
final String accessToken = jwks.toAccessToken().encryptForUser(userKeys.ecdhKeyPair().getPublic());
109109

110110
final UUID vaultId = UUID.randomUUID();

0 commit comments

Comments
 (0)