Skip to content

Commit 43a3a2f

Browse files
fix java
1 parent 8d56ebb commit 43a3a2f

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

src/test/java/io/lettuce/core/SslIntegrationTests.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ class SslIntegrationTests extends TestSupport {
7070
private static final String KEYSTORE = "work/keystore.jks";
7171

7272
private static File truststoreFile0;
73+
7374
private static File truststoreFile1;
75+
7476
private static File truststoreFile2;
7577

7678
private static File cacertFile;
@@ -122,12 +124,11 @@ static void beforeClass() {
122124
truststoreFile1 = path.toFile();
123125
cacertFile = envCa(Paths.get("redis-standalone-1/work/tls")).toFile();
124126

125-
Path path2 = createAndSaveTestTruststore("redis-standalone-sentinel-controlled", Paths.get("redis-standalone-sentinel-controlled/work/tls"), "changeit");
127+
Path path2 = createAndSaveTestTruststore("redis-standalone-sentinel-controlled",
128+
Paths.get("redis-standalone-sentinel-controlled/work/tls"), "changeit");
126129
truststoreFile2 = path2.toFile();
127130
cacertFile = envCa(Paths.get("redis-standalone-sentinel-controlled/work/tls")).toFile();
128131

129-
130-
131132
assumeTrue(CanConnect.to(TestSettings.host(), sslPort()), "Assume that stunnel runs on port 6443");
132133
// Maybe we should do a list.
133134
assertThat(truststoreFile0).exists();
@@ -211,7 +212,7 @@ void standaloneWithJdkSslUsingTruststoreUrl() throws Exception {
211212

212213
@Test
213214
void standaloneWithClientCertificates() {
214-
//6445
215+
// 6445
215216
SslOptions sslOptions = SslOptions.builder() //
216217
.jdkSslProvider() //
217218
.keystore(new File(KEYSTORE), "changeit".toCharArray()) //

src/test/java/io/lettuce/test/settings/TlsSettings.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ public static Path testTruststorePath(String name) {
4343
* Creates an empty truststore.
4444
*
4545
* @return An empty KeyStore object.
46-
* @throws KeyStoreException If there's an error initializing the truststore.
47-
* @throws IOException If there's an error loading the truststore.
46+
* @throws KeyStoreException If there's an error initializing the truststore.
47+
* @throws IOException If there's an error loading the truststore.
4848
* @throws NoSuchAlgorithmException If the algorithm used to check the integrity of the truststore cannot be found.
49-
* @throws CertificateException If any of the certificates in the truststore could not be loaded.
49+
* @throws CertificateException If any of the certificates in the truststore could not be loaded.
5050
*/
5151
private static KeyStore createTruststore()
5252
throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {
@@ -73,8 +73,8 @@ private static X509Certificate loadCertificate(Path certPath) throws Exception {
7373
* Adds a trusted certificate to the given truststore.
7474
*
7575
* @param trustStore The KeyStore object.
76-
* @param alias Alias for the certificate.
77-
* @param certPath Path to the certificate file.
76+
* @param alias Alias for the certificate.
77+
* @param certPath Path to the certificate file.
7878
* @throws Exception If there's an error adding the certificate.
7979
*/
8080
private static void addTrustedCertificate(KeyStore trustStore, String alias, Path certPath) throws Exception {
@@ -85,8 +85,8 @@ private static void addTrustedCertificate(KeyStore trustStore, String alias, Pat
8585
/**
8686
* Creates a truststore, adds multiple trusted certificates, and saves it to the specified path.
8787
*
88-
* @param trustedCertPaths List of certificate file paths to add to the truststore.
89-
* @param truststorePath Path to save the generated truststore.
88+
* @param trustedCertPaths List of certificate file paths to add to the truststore.
89+
* @param truststorePath Path to save the generated truststore.
9090
* @param truststorePassword Password for the truststore.
9191
* @return Path to the saved truststore file.
9292
*/
@@ -111,7 +111,7 @@ public static Path createAndSaveTruststore(List<Path> trustedCertPaths, Path tru
111111
}
112112

113113
public static Path createAndSaveTestTruststore(String trustStoreName, Path certificateLocations,
114-
String truststorePassword) {
114+
String truststorePassword) {
115115
List<Path> trustedCertPaths = new ArrayList<>();
116116
trustedCertPaths.add(envCa(certificateLocations).toAbsolutePath());
117117
trustedCertPaths.add(envServerCert(certificateLocations).toAbsolutePath());
@@ -120,4 +120,5 @@ public static Path createAndSaveTestTruststore(String trustStoreName, Path certi
120120

121121
return createAndSaveTruststore(trustedCertPaths, trustStorePath, truststorePassword);
122122
}
123-
}
123+
124+
}

0 commit comments

Comments
 (0)