@@ -135,8 +135,7 @@ public static void beforeAll() throws SQLException {
135
135
walletKeyService ,
136
136
holdersCredentialRepository ,
137
137
commonService ,
138
- objectMapper
139
- );
138
+ objectMapper );
140
139
}
141
140
142
141
@ BeforeEach
@@ -174,10 +173,10 @@ void shouldIssueCredentialAsJwt()
174
173
when (walletKey .getKeyId ()).thenReturn (KEY_ID );
175
174
when (walletKey .getId ()).thenReturn (42L );
176
175
when (baseWallet .getAlgorithm ()).thenReturn ("ED25519" );
177
- when (walletKeyService .getPrivateKeyByWalletIdAndAlgorithm (baseWallet .getId () , SupportedAlgorithms .valueOf (baseWallet .getAlgorithm ())))
176
+ when (walletKeyService .getPrivateKeyByWalletIdAndAlgorithm (baseWallet .getId (), SupportedAlgorithms .valueOf (baseWallet .getAlgorithm ())))
178
177
.thenReturn (new X25519PrivateKey (keyPair .getPrivateKey ().asStringForStoring (), true ));
179
178
when (walletKeyService .getWalletKeyIdByWalletId (baseWallet .getId ())).thenReturn (walletKeyId );
180
- when (walletKeyService .getPrivateKeyByWalletIdAsBytes (baseWallet .getId () , "ED25519" )).thenReturn (keyPair .getPrivateKey ()
179
+ when (walletKeyService .getPrivateKeyByWalletIdAsBytes (baseWallet .getId (), "ED25519" )).thenReturn (keyPair .getPrivateKey ()
181
180
.asByte ());
182
181
CredentialsResponse credentialsResponse = assertDoesNotThrow (
183
182
() -> issuersCredentialService .issueMembershipCredential (
@@ -225,9 +224,9 @@ void shouldIssueCredentialAsJwt()
225
224
when (walletKey .getKeyId ()).thenReturn (KEY_ID );
226
225
when (walletKey .getId ()).thenReturn (42L );
227
226
when (baseWallet .getAlgorithm ()).thenReturn ("ED25519" );
228
- when (walletKeyService .getPrivateKeyByWalletIdAsBytes (baseWallet .getId () , "ED25519" )).thenReturn (keyPair .getPrivateKey ()
227
+ when (walletKeyService .getPrivateKeyByWalletIdAsBytes (baseWallet .getId (), "ED25519" )).thenReturn (keyPair .getPrivateKey ()
229
228
.asByte ());
230
- when (walletKeyService .getPrivateKeyByWalletIdAndAlgorithm (baseWallet .getId () , SupportedAlgorithms .valueOf (baseWallet .getAlgorithm ())))
229
+ when (walletKeyService .getPrivateKeyByWalletIdAndAlgorithm (baseWallet .getId (), SupportedAlgorithms .valueOf (baseWallet .getAlgorithm ())))
231
230
.thenReturn (new X25519PrivateKey (keyPair .getPrivateKey ().asStringForStoring (), true ));
232
231
when (walletKeyService .getWalletKeyIdByWalletId (baseWallet .getId ())).thenReturn (walletKeyId );
233
232
@@ -266,10 +265,9 @@ void shouldIssueCredentialAsJwt() throws IOException, InvalidPrivateKeyFormatExc
266
265
when (walletKey .getKeyId ()).thenReturn (KEY_ID );
267
266
when (walletKey .getId ()).thenReturn (42L );
268
267
when (baseWallet .getAlgorithm ()).thenReturn ("ED25519" );
269
- when (walletKeyService .getPrivateKeyByWalletIdAndAlgorithm (baseWallet .getId () , SupportedAlgorithms .valueOf (baseWallet .getAlgorithm ())))
268
+ when (walletKeyService .getPrivateKeyByWalletIdAndAlgorithm (baseWallet .getId (), SupportedAlgorithms .valueOf (baseWallet .getAlgorithm ())))
270
269
.thenReturn (new X25519PrivateKey (keyPair .getPrivateKey ().asStringForStoring (), true ));
271
- when (walletKeyService .getPrivateKeyByWalletIdAsBytes (baseWallet .getId () , "ED25519" )).thenReturn (keyPair .getPrivateKey ()
272
- .asByte ());
270
+ when (walletKeyService .getPrivateKeyByWalletIdAsBytes (baseWallet .getId (), "ED25519" )).thenReturn (keyPair .getPrivateKey ().asByte ());
273
271
when (walletKeyService .getWalletKeyIdByWalletId (baseWallet .getId ())).thenReturn (walletKeyId );
274
272
275
273
CredentialsResponse credentialsResponse = assertDoesNotThrow (
@@ -301,7 +299,7 @@ void shouldIssueCredentialAsJwt() throws IOException, ParseException, InvalidPri
301
299
MockUtil .generateDid ("basewallet" )).build ();
302
300
303
301
MockUtil .makeCreateWorkForIssuer (issuersCredentialRepository );
304
- when (walletKeyService .getPrivateKeyByWalletIdAsBytes (baseWallet .getId () , "ED25519" )).thenReturn (keyPair .getPrivateKey ()
302
+ when (walletKeyService .getPrivateKeyByWalletIdAsBytes (baseWallet .getId (), "ED25519" )).thenReturn (keyPair .getPrivateKey ()
305
303
.asByte ());
306
304
when (commonService .getWalletByIdentifier (holderWalletBpn )).thenReturn (holderWallet );
307
305
when (commonService .getWalletByIdentifier (verifiableCredential .getIssuer ()
@@ -321,7 +319,7 @@ public HoldersCredential answer(InvocationOnMock invocation) throws Throwable {
321
319
when (walletKey .getKeyId ()).thenReturn (KEY_ID );
322
320
when (baseWallet .getAlgorithm ()).thenReturn ("ED25519" );
323
321
when (walletKey .getId ()).thenReturn (42L );
324
- when (walletKeyService .getPrivateKeyByWalletIdAndAlgorithm (baseWallet .getId () , SupportedAlgorithms .valueOf (baseWallet .getAlgorithm ())))
322
+ when (walletKeyService .getPrivateKeyByWalletIdAndAlgorithm (baseWallet .getId (), SupportedAlgorithms .valueOf (baseWallet .getAlgorithm ())))
325
323
.thenReturn (new X25519PrivateKey (keyPair .getPrivateKey ().asStringForStoring (), true ));
326
324
when (walletKeyService .getWalletKeyIdByWalletId (baseWallet .getId ())).thenReturn (walletKeyId );
327
325
@@ -343,9 +341,8 @@ class jwtValidationTest {
343
341
344
342
@ RegisterExtension
345
343
static WireMockExtension issuer = WireMockExtension .newInstance ()
346
- .options (wireMockConfig ()
347
- .dynamicPort ()
348
- // .notifier(new ConsoleNotifier(true))
344
+ .options (wireMockConfig ().dynamicPort ()
345
+ // .notifier(new ConsoleNotifier(true))
349
346
)
350
347
.build ();
351
348
@@ -435,7 +432,7 @@ private void mockCommon(
435
432
when (miwSettings .authorityWalletBpn ()).thenReturn (baseWalletBpn );
436
433
when (commonService .getWalletByIdentifier (baseWalletBpn )).thenReturn (baseWallet );
437
434
when (commonService .getWalletByIdentifier (holderWalletBpn )).thenReturn (holderWallet );
438
- when (walletKeyService .getPrivateKeyByWalletIdAsBytes (baseWallet .getId () , baseWallet .getAlgorithm ()))
435
+ when (walletKeyService .getPrivateKeyByWalletIdAsBytes (baseWallet .getId (), baseWallet .getAlgorithm ()))
439
436
.thenReturn (keyPair .getPrivateKey ().asByte ());
440
437
when (miwSettings .supportedFrameworkVCTypes ()).thenReturn (Set .of ("SustainabilityCredential" ));
441
438
when (holdersCredentialRepository .save (any (HoldersCredential .class )))
0 commit comments