2
2
3
3
import io .apicurio .common .apps .config .Info ;
4
4
import io .apicurio .registry .AbstractResourceTestBase ;
5
+ import io .apicurio .registry .client .auth .VertXAuthFactory ;
5
6
import io .apicurio .registry .model .GroupId ;
6
7
import io .apicurio .registry .rest .client .RegistryClient ;
7
8
import io .apicurio .registry .rest .client .models .CreateArtifact ;
19
20
import io .kiota .http .vertx .VertXRequestAdapter ;
20
21
import io .quarkus .test .junit .QuarkusTest ;
21
22
import io .quarkus .test .junit .TestProfile ;
23
+ import io .vertx .core .Vertx ;
22
24
import org .eclipse .microprofile .config .inject .ConfigProperty ;
23
25
import org .junit .jupiter .api .Assertions ;
24
26
import org .junit .jupiter .api .Tag ;
25
27
import org .junit .jupiter .api .Test ;
26
28
27
- import static io .apicurio .registry .client .auth .VertXAuthFactory .buildOIDCWebClient ;
28
29
import static org .junit .jupiter .api .Assertions .assertNotNull ;
29
30
import static org .junit .jupiter .api .Assertions .assertTrue ;
30
31
@@ -40,17 +41,17 @@ public class AuthTestNoRoles extends AbstractResourceTestBase {
40
41
final String groupId = "authTestGroupId" ;
41
42
42
43
@ Override
43
- protected RegistryClient createRestClientV3 () {
44
- var adapter = new VertXRequestAdapter (
45
- buildOIDCWebClient ( authServerUrlConfigured , JWKSMockServer .ADMIN_CLIENT_ID , "test1" ));
44
+ protected RegistryClient createRestClientV3 (Vertx vertx ) {
45
+ var adapter = new VertXRequestAdapter (VertXAuthFactory . buildOIDCWebClient ( vertx ,
46
+ authServerUrlConfigured , JWKSMockServer .ADMIN_CLIENT_ID , "test1" ));
46
47
adapter .setBaseUrl (registryV3ApiUrl );
47
48
return new RegistryClient (adapter );
48
49
}
49
50
50
51
@ Test
51
52
public void testWrongCreds () throws Exception {
52
- var adapter = new VertXRequestAdapter (
53
- buildOIDCWebClient ( authServerUrlConfigured , JWKSMockServer .WRONG_CREDS_CLIENT_ID , "test55" ));
53
+ var adapter = new VertXRequestAdapter (VertXAuthFactory . buildOIDCWebClient ( vertx ,
54
+ authServerUrlConfigured , JWKSMockServer .WRONG_CREDS_CLIENT_ID , "test55" ));
54
55
adapter .setBaseUrl (registryV3ApiUrl );
55
56
RegistryClient client = new RegistryClient (adapter );
56
57
var exception = Assertions .assertThrows (Exception .class , () -> {
@@ -61,8 +62,8 @@ public void testWrongCreds() throws Exception {
61
62
62
63
@ Test
63
64
public void testAdminRole () throws Exception {
64
- var adapter = new VertXRequestAdapter (
65
- buildOIDCWebClient ( authServerUrlConfigured , JWKSMockServer .ADMIN_CLIENT_ID , "test1" ));
65
+ var adapter = new VertXRequestAdapter (VertXAuthFactory . buildOIDCWebClient ( vertx ,
66
+ authServerUrlConfigured , JWKSMockServer .ADMIN_CLIENT_ID , "test1" ));
66
67
adapter .setBaseUrl (registryV3ApiUrl );
67
68
RegistryClient client = new RegistryClient (adapter );
68
69
String artifactId = TestUtils .generateArtifactId ();
0 commit comments