7
7
import io .apicurio .registry .rest .client .models .CreateGroup ;
8
8
import io .apicurio .registry .rest .client .models .CreateRule ;
9
9
import io .apicurio .registry .rest .client .models .CreateVersion ;
10
- import io .apicurio .registry .rest .client .models .Error ;
11
10
import io .apicurio .registry .rest .client .models .IfArtifactExists ;
11
+ import io .apicurio .registry .rest .client .models .ProblemDetails ;
12
12
import io .apicurio .registry .rest .client .models .RuleType ;
13
13
import io .apicurio .registry .rest .client .models .VersionMetaData ;
14
14
import io .apicurio .registry .rest .client .models .VersionSearchResults ;
@@ -71,22 +71,22 @@ public void testCreateArtifactDryRun() throws Exception {
71
71
ArtifactSearchResults results = clientV3 .groups ().byGroupId (groupId ).artifacts ().get ();
72
72
Assertions .assertEquals (0 , results .getCount ());
73
73
Assertions .assertEquals (0 , results .getArtifacts ().size ());
74
- Error error = Assertions .assertThrows (Error .class , () -> {
74
+ ProblemDetails error = Assertions .assertThrows (ProblemDetails .class , () -> {
75
75
clientV3 .groups ().byGroupId (groupId ).artifacts ().byArtifactId ("valid-artifact" ).get ();
76
76
});
77
77
Assertions .assertEquals (
78
78
"No artifact with ID 'valid-artifact' in group 'testCreateArtifactDryRun' was found." ,
79
- error .getMessageEscaped ());
79
+ error .getTitle ());
80
80
81
81
// Dry run: invalid artifact that should NOT be created.
82
- error = Assertions .assertThrows (Error .class , () -> {
82
+ error = Assertions .assertThrows (ProblemDetails .class , () -> {
83
83
CreateArtifact ca = TestUtils .clientCreateArtifact ("invalid-artifact" , ArtifactType .AVRO ,
84
84
INVALID_SCHEMA , ContentTypes .APPLICATION_JSON );
85
85
clientV3 .groups ().byGroupId (groupId ).artifacts ().post (ca , config -> {
86
86
config .queryParameters .dryRun = true ;
87
87
});
88
88
});
89
- Assertions .assertEquals ("Syntax violation for Avro artifact." , error .getMessageEscaped ());
89
+ Assertions .assertEquals ("Syntax violation for Avro artifact." , error .getTitle ());
90
90
Assertions .assertNotNull (car );
91
91
Assertions .assertEquals (groupId , car .getArtifact ().getGroupId ());
92
92
Assertions .assertEquals ("valid-artifact" , car .getArtifact ().getArtifactId ());
@@ -96,12 +96,12 @@ public void testCreateArtifactDryRun() throws Exception {
96
96
results = clientV3 .groups ().byGroupId (groupId ).artifacts ().get ();
97
97
Assertions .assertEquals (0 , results .getCount ());
98
98
Assertions .assertEquals (0 , results .getArtifacts ().size ());
99
- error = Assertions .assertThrows (Error .class , () -> {
99
+ error = Assertions .assertThrows (ProblemDetails .class , () -> {
100
100
clientV3 .groups ().byGroupId (groupId ).artifacts ().byArtifactId ("invalid-artifact" ).get ();
101
101
});
102
102
Assertions .assertEquals (
103
103
"No artifact with ID 'invalid-artifact' in group 'testCreateArtifactDryRun' was found." ,
104
- error .getMessageEscaped ());
104
+ error .getTitle ());
105
105
106
106
// Actually create an artifact in the group.
107
107
createArtifact (groupId , "actual-artifact" , ArtifactType .AVRO , SCHEMA_SIMPLE ,
@@ -111,7 +111,7 @@ public void testCreateArtifactDryRun() throws Exception {
111
111
Assertions .assertEquals (1 , results .getArtifacts ().size ());
112
112
113
113
// DryRun: Try to create the *same* artifact (conflict)
114
- error = Assertions .assertThrows (Error .class , () -> {
114
+ error = Assertions .assertThrows (ProblemDetails .class , () -> {
115
115
CreateArtifact ca = TestUtils .clientCreateArtifact ("actual-artifact" , ArtifactType .AVRO ,
116
116
SCHEMA_SIMPLE , ContentTypes .APPLICATION_JSON );
117
117
clientV3 .groups ().byGroupId (groupId ).artifacts ().post (ca , config -> {
@@ -120,7 +120,7 @@ public void testCreateArtifactDryRun() throws Exception {
120
120
});
121
121
Assertions .assertEquals (
122
122
"An artifact with ID 'actual-artifact' in group 'testCreateArtifactDryRun' already exists." ,
123
- error .getMessageEscaped ());
123
+ error .getTitle ());
124
124
125
125
// DryRun: Try to create the *same* artifact but with ifExists set (success)
126
126
createArtifact = TestUtils .clientCreateArtifact ("actual-artifact" , ArtifactType .AVRO , SCHEMA_SIMPLE ,
@@ -165,15 +165,15 @@ public void testCreateVersionDryRun() throws Exception {
165
165
createArtifact (groupId , artifactId , ArtifactType .AVRO , SCHEMA_SIMPLE , ContentTypes .APPLICATION_JSON );
166
166
167
167
// DryRun: try to create an invalid version
168
- Error error = Assertions .assertThrows (Error .class , () -> {
168
+ ProblemDetails error = Assertions .assertThrows (ProblemDetails .class , () -> {
169
169
CreateVersion createVersion = TestUtils .clientCreateVersion (INVALID_SCHEMA ,
170
170
ContentTypes .APPLICATION_JSON );
171
171
clientV3 .groups ().byGroupId (groupId ).artifacts ().byArtifactId (artifactId ).versions ()
172
172
.post (createVersion , config -> {
173
173
config .queryParameters .dryRun = true ;
174
174
});
175
175
});
176
- Assertions .assertEquals ("Syntax violation for Avro artifact." , error .getMessageEscaped ());
176
+ Assertions .assertEquals ("Syntax violation for Avro artifact." , error .getTitle ());
177
177
178
178
// DryRun: try to create a valid version (appears to work)
179
179
{
0 commit comments