Skip to content

Commit 700e032

Browse files
committed
apply make fmt
1 parent 7a3fb20 commit 700e032

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

core/src/main/java/cloud/stackit/sdk/core/KeyFlowAuthenticator.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.util.concurrent.TimeUnit;
2626
import java.util.concurrent.locks.Lock;
2727
import java.util.concurrent.locks.ReentrantLock;
28-
2928
import okhttp3.*;
3029
import org.jetbrains.annotations.NotNull;
3130

@@ -191,8 +190,7 @@ protected String getAccessToken() {
191190
* @throws IOException request for new access token failed
192191
* @throws ApiException response for new access token with bad status code
193192
*/
194-
public String getAccessToken()
195-
throws IOException, ApiException, InvalidKeySpecException {
193+
public String getAccessToken() throws IOException, ApiException, InvalidKeySpecException {
196194
try {
197195
tokenRefreshLock.lock();
198196

@@ -201,8 +199,7 @@ public String getAccessToken()
201199
} else if (token.isExpired()) {
202200
createAccessTokenWithRefreshToken();
203201
}
204-
}
205-
finally {
202+
} finally {
206203
tokenRefreshLock.unlock();
207204
}
208205

core/src/main/java/cloud/stackit/sdk/core/auth/SetupAuth.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import java.nio.file.Paths;
1919
import java.util.Map;
2020
import javax.swing.filechooser.FileSystemView;
21-
2221
import okhttp3.Interceptor;
2322

2423
public class SetupAuth {
@@ -44,6 +43,7 @@ public class SetupAuth {
4443
public SetupAuth() {
4544
// deprecated
4645
}
46+
4747
// TODO: constructor of SetupAuth should be private after deprecated constructors/methods are
4848
// removed (only static methods should remain)
4949

core/src/test/java/cloud/stackit/sdk/core/auth/SetupAuthTest.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class SetupAuthTest {
4444
+ File.separator
4545
+ "file.json";
4646

47-
4847
private ServiceAccountKey createDummyServiceAccount(String privateKey) {
4948
ServiceAccountCredentials credentials =
5049
new ServiceAccountCredentials("aud", "iss", "kid", privateKey, "sub");
@@ -81,7 +80,8 @@ void testGetAccessTokenWithoutRunningInitThrowsException() throws IOException {
8180
@Test
8281
@DisplayName("get access token - with running init - returns interceptor")
8382
void testGetAccessTokenWithRunningInitReturnsInterceptor() throws IOException {
84-
ServiceAccountKey saKey = createDummyServiceAccount(TestUtils.MOCK_SERVICE_ACCOUNT_PRIVATE_KEY);
83+
ServiceAccountKey saKey =
84+
createDummyServiceAccount(TestUtils.MOCK_SERVICE_ACCOUNT_PRIVATE_KEY);
8585
String initSaKeyJson = new Gson().toJson(saKey);
8686

8787
CoreConfiguration config = new CoreConfiguration().serviceAccountKey(initSaKeyJson);
@@ -95,7 +95,8 @@ void testGetAccessTokenWithRunningInitReturnsInterceptor() throws IOException {
9595
@DisplayName("setup key flow - read service account from path")
9696
void setupKeyFlowReadServiceAccountFromPath() throws IOException {
9797
// Create service account key file
98-
ServiceAccountKey initSaKey = createDummyServiceAccount(TestUtils.MOCK_SERVICE_ACCOUNT_PRIVATE_KEY);
98+
ServiceAccountKey initSaKey =
99+
createDummyServiceAccount(TestUtils.MOCK_SERVICE_ACCOUNT_PRIVATE_KEY);
99100
String initSaKeyJson = new Gson().toJson(initSaKey);
100101
Path saKeyPath = Files.createTempFile("serviceAccountKey", JSON_FILE_EXTENSION);
101102
saKeyPath.toFile().deleteOnExit();
@@ -114,7 +115,8 @@ void setupKeyFlowReadServiceAccountFromPath() throws IOException {
114115
@DisplayName("setup key flow - read service account from config")
115116
void setupKeyFlowReadServiceAccountFromConfig() throws IOException {
116117
// Create service account key
117-
ServiceAccountKey initSaKey = createDummyServiceAccount(TestUtils.MOCK_SERVICE_ACCOUNT_PRIVATE_KEY);
118+
ServiceAccountKey initSaKey =
119+
createDummyServiceAccount(TestUtils.MOCK_SERVICE_ACCOUNT_PRIVATE_KEY);
118120
String initSaKeyJson = new Gson().toJson(initSaKey);
119121

120122
// Create config and read setup auth with the previous created saKey
@@ -128,7 +130,8 @@ void setupKeyFlowReadServiceAccountFromConfig() throws IOException {
128130
@DisplayName("setup key flow - read service account from key env")
129131
void setupKeyFlowReadServiceAccountFromKeyEnv() throws IOException {
130132
// Create service account key
131-
ServiceAccountKey initSaKey = createDummyServiceAccount(TestUtils.MOCK_SERVICE_ACCOUNT_PRIVATE_KEY);
133+
ServiceAccountKey initSaKey =
134+
createDummyServiceAccount(TestUtils.MOCK_SERVICE_ACCOUNT_PRIVATE_KEY);
132135
String initSaKeyJson = new Gson().toJson(initSaKey);
133136

134137
// Mock env STACKIT_SERVICE_ACCOUNT_KEY
@@ -236,7 +239,7 @@ void loadPrivateKeyDoesNotOverwriteExistingPrivateKey() {
236239

237240
@Test
238241
@DisplayName("load private key - set private key path")
239-
void loadPrivateKeySetPrivateKeyPath() throws IOException{
242+
void loadPrivateKeySetPrivateKeyPath() throws IOException {
240243
Path tempPrvKeyFile = Files.createTempFile("privateKey", ".pem");
241244
tempPrvKeyFile.toFile().deleteOnExit();
242245

0 commit comments

Comments
 (0)