1616import ch .iterate .hub .crypto .UserKeys ;
1717import ch .iterate .hub .protocols .hub .HubSession ;
1818import ch .iterate .hub .testsetup .AbstractHubTest ;
19- import ch .iterate .hub .testsetup .docker_setup . UnattendedLocalOnly ;
20- import ch .iterate .hub .testsetup .model . HubTestConfig ;
19+ import ch .iterate .hub .testsetup .HubTestConfig ;
20+ import ch .iterate .hub .testsetup .HubTestSetupDockerExtension ;
2121import com .nimbusds .jose .JOSEException ;
2222
23- import static ch .iterate .hub .testsetup .HubTestSetupConfigs .minioSTSUnattendedLocalOnly ;
24- import static ch .iterate .hub .testsetup .HubTestUtilities .setupForUser ;
25- import static org .junit .Assert .assertNotNull ;
26- import static org .junit .jupiter .api .Assertions .assertThrows ;
27- import static org .junit .jupiter .api .Assertions .assertTrue ;
23+ import static org .junit .jupiter .api .Assertions .*;
2824
2925@ TestInstance (TestInstance .Lifecycle .PER_CLASS )
30- @ ExtendWith ({UnattendedLocalOnly .class })
26+ @ ExtendWith ({HubTestSetupDockerExtension . UnattendedLocalOnly .class })
3127public class UserKeysRecoveryTest extends AbstractHubTest {
3228
3329 private Stream <Arguments > arguments () {
@@ -37,15 +33,14 @@ private Stream<Arguments> arguments() {
3733 @ ParameterizedTest
3834 @ MethodSource ("arguments" )
3935 public void firstLoginAndUserKeyRecovery (final HubTestConfig hubTestConfig ) throws Exception {
40- final HubSession hubSession = setupForUser (hubTestConfig .hubTestSetupConfig , hubTestConfig . hubTestSetupConfig . USER_001 () );
36+ final HubSession hubSession = setupConnection (hubTestConfig .setup );
4137 final UsersResourceApi usersApi = new UsersResourceApi (hubSession .getClient ());
4238 final UserDto me = usersApi .apiUsersMeGet (true );
4339
4440 final JOSEException exception = assertThrows (JOSEException .class , () -> UserKeys .recover (me .getEcdhPublicKey (), me .getEcdsaPublicKey (), me .getPrivateKey (),
4541 new AlphanumericRandomStringService ().random ()));
46- assertTrue (exception .getCause () instanceof InvalidKeyException );
47-
42+ assertInstanceOf (InvalidKeyException .class , exception .getCause ());
4843 assertNotNull (UserKeys .recover (me .getEcdhPublicKey (), me .getEcdsaPublicKey (), me .getPrivateKey (),
49- hubTestConfig .hubTestSetupConfig . USER_001 () .setupCode ));
44+ hubTestConfig .setup . userConfig .setupCode ));
5045 }
5146}
0 commit comments