|
8 | 8 | import io.apicurio.registry.types.ArtifactType;
|
9 | 9 | import io.apicurio.registry.utils.tests.*;
|
10 | 10 | import io.kiota.http.vertx.VertXRequestAdapter;
|
| 11 | +import io.quarkus.security.AuthenticationFailedException; |
11 | 12 | import io.quarkus.test.junit.QuarkusTest;
|
12 | 13 | import io.quarkus.test.junit.TestProfile;
|
13 | 14 | import org.junit.jupiter.api.Assertions;
|
@@ -62,10 +63,9 @@ public void testWrongCreds() throws Exception {
|
62 | 63 | var adapter = new VertXRequestAdapter(buildSimpleAuthWebClient(UUID.randomUUID().toString(), UUID.randomUUID().toString()));
|
63 | 64 | adapter.setBaseUrl(registryV3ApiUrl);
|
64 | 65 | RegistryClient client = new RegistryClient(adapter);
|
65 |
| - var exception = Assertions.assertThrows(Exception.class, () -> { |
| 66 | + Assertions.assertThrows(AuthenticationFailedException.class, () -> { |
66 | 67 | client.groups().byGroupId(groupId).artifacts().get();
|
67 | 68 | });
|
68 |
| - assertTrue(exception.getMessage().contains("Unauthorized")); |
69 | 69 | }
|
70 | 70 |
|
71 | 71 | @Test
|
@@ -253,11 +253,11 @@ public void testGetArtifactOwner() throws Exception {
|
253 | 253 | assertEquals(groupId, created.getGroupId());
|
254 | 254 | assertEquals(artifactId, created.getArtifactId());
|
255 | 255 | assertEquals(version, created.getVersion());
|
256 |
| - assertEquals("developer-client", created.getOwner()); |
| 256 | + assertEquals(DEVELOPER_USERNAME, created.getOwner()); |
257 | 257 |
|
258 | 258 | //Get the artifact owner via the REST API and verify it
|
259 | 259 | ArtifactMetaData amd = client.groups().byGroupId(groupId).artifacts().byArtifactId(artifactId).get();
|
260 |
| - assertEquals("developer-client", amd.getOwner()); |
| 260 | + assertEquals(DEVELOPER_USERNAME, amd.getOwner()); |
261 | 261 | }
|
262 | 262 |
|
263 | 263 | @Test
|
@@ -291,20 +291,20 @@ public void testUpdateArtifactOwner() throws Exception {
|
291 | 291 | assertEquals(groupId, created.getGroupId());
|
292 | 292 | assertEquals(artifactId, created.getArtifactId());
|
293 | 293 | assertEquals(version, created.getVersion());
|
294 |
| - assertEquals("developer-client", created.getOwner()); |
| 294 | + assertEquals(DEVELOPER_USERNAME, created.getOwner()); |
295 | 295 |
|
296 | 296 | //Get the artifact owner via the REST API and verify it
|
297 | 297 | ArtifactMetaData amd = client.groups().byGroupId(groupId).artifacts().byArtifactId(artifactId).get();
|
298 |
| - assertEquals("developer-client", amd.getOwner()); |
| 298 | + assertEquals(DEVELOPER_USERNAME, amd.getOwner()); |
299 | 299 |
|
300 | 300 | //Update the owner
|
301 | 301 | EditableArtifactMetaData eamd = new EditableArtifactMetaData();
|
302 |
| - eamd.setOwner("developer-2-client"); |
| 302 | + eamd.setOwner(DEVELOPER_2_USERNAME); |
303 | 303 | client.groups().byGroupId(groupId).artifacts().byArtifactId(artifactId).put(eamd);
|
304 | 304 |
|
305 | 305 | //Check that the update worked
|
306 | 306 | amd = client.groups().byGroupId(groupId).artifacts().byArtifactId(artifactId).get();
|
307 |
| - assertEquals("developer-2-client", amd.getOwner()); |
| 307 | + assertEquals(DEVELOPER_2_USERNAME, amd.getOwner()); |
308 | 308 | }
|
309 | 309 |
|
310 | 310 | @Test
|
|
0 commit comments