@@ -22,28 +22,28 @@ func TestParse(t *testing.T) {
22
22
name : "Valid/BasicGVK" ,
23
23
input : json .RawMessage (inputBasicGVK ),
24
24
expConstraint : Constraint {
25
- Message : "blah" ,
26
- GVK : & GVKConstraint {Group : "example.com" , Version : "v1" , Kind : "Foo" },
25
+ FailureMessage : "blah" ,
26
+ GVK : & GVKConstraint {Group : "example.com" , Version : "v1" , Kind : "Foo" },
27
27
},
28
28
},
29
29
{
30
30
name : "Valid/BasicPackage" ,
31
31
input : json .RawMessage (inputBasicPackage ),
32
32
expConstraint : Constraint {
33
- Message : "blah" ,
34
- Package : & PackageConstraint {PackageName : "foo" , VersionRange : ">=1.0.0" },
33
+ FailureMessage : "blah" ,
34
+ Package : & PackageConstraint {PackageName : "foo" , VersionRange : ">=1.0.0" },
35
35
},
36
36
},
37
37
{
38
38
name : "Valid/BasicAll" ,
39
39
input : json .RawMessage (fmt .Sprintf (inputBasicCompoundTmpl , "all" )),
40
40
expConstraint : Constraint {
41
- Message : "blah" ,
41
+ FailureMessage : "blah" ,
42
42
All : & CompoundConstraint {
43
43
Constraints : []Constraint {
44
44
{
45
- Message : "blah blah" ,
46
- Package : & PackageConstraint {PackageName : "fuz" , VersionRange : ">=1.0.0" },
45
+ FailureMessage : "blah blah" ,
46
+ Package : & PackageConstraint {PackageName : "fuz" , VersionRange : ">=1.0.0" },
47
47
},
48
48
},
49
49
},
@@ -53,27 +53,27 @@ func TestParse(t *testing.T) {
53
53
name : "Valid/BasicAny" ,
54
54
input : json .RawMessage (fmt .Sprintf (inputBasicCompoundTmpl , "any" )),
55
55
expConstraint : Constraint {
56
- Message : "blah" ,
56
+ FailureMessage : "blah" ,
57
57
Any : & CompoundConstraint {
58
58
Constraints : []Constraint {
59
59
{
60
- Message : "blah blah" ,
61
- Package : & PackageConstraint {PackageName : "fuz" , VersionRange : ">=1.0.0" },
60
+ FailureMessage : "blah blah" ,
61
+ Package : & PackageConstraint {PackageName : "fuz" , VersionRange : ">=1.0.0" },
62
62
},
63
63
},
64
64
},
65
65
},
66
66
},
67
67
{
68
- name : "Valid/BasicNone " ,
69
- input : json .RawMessage (fmt .Sprintf (inputBasicCompoundTmpl , "none " )),
68
+ name : "Valid/BasicNot " ,
69
+ input : json .RawMessage (fmt .Sprintf (inputBasicCompoundTmpl , "not " )),
70
70
expConstraint : Constraint {
71
- Message : "blah" ,
72
- None : & CompoundConstraint {
71
+ FailureMessage : "blah" ,
72
+ Not : & CompoundConstraint {
73
73
Constraints : []Constraint {
74
74
{
75
- Message : "blah blah" ,
76
- Package : & PackageConstraint {PackageName : "fuz" , VersionRange : ">=1.0.0" },
75
+ FailureMessage : "blah blah" ,
76
+ Package : & PackageConstraint {PackageName : "fuz" , VersionRange : ">=1.0.0" },
77
77
},
78
78
},
79
79
},
@@ -83,13 +83,13 @@ func TestParse(t *testing.T) {
83
83
name : "Valid/Complex" ,
84
84
input : json .RawMessage (inputComplex ),
85
85
expConstraint : Constraint {
86
- Message : "blah" ,
86
+ FailureMessage : "blah" ,
87
87
All : & CompoundConstraint {
88
88
Constraints : []Constraint {
89
89
{Package : & PackageConstraint {PackageName : "fuz" , VersionRange : ">=1.0.0" }},
90
90
{GVK : & GVKConstraint {Group : "fals.example.com" , Kind : "Fal" , Version : "v1" }},
91
91
{
92
- Message : "foo and buf must be stable versions" ,
92
+ FailureMessage : "foo and buf must be stable versions" ,
93
93
All : & CompoundConstraint {
94
94
Constraints : []Constraint {
95
95
{Package : & PackageConstraint {PackageName : "foo" , VersionRange : ">=1.0.0" }},
@@ -99,7 +99,7 @@ func TestParse(t *testing.T) {
99
99
},
100
100
},
101
101
{
102
- Message : "blah blah" ,
102
+ FailureMessage : "blah blah" ,
103
103
Any : & CompoundConstraint {
104
104
Constraints : []Constraint {
105
105
{GVK : & GVKConstraint {Group : "foos.example.com" , Kind : "Foo" , Version : "v1beta1" }},
@@ -109,7 +109,7 @@ func TestParse(t *testing.T) {
109
109
},
110
110
},
111
111
{
112
- None : & CompoundConstraint {
112
+ Not : & CompoundConstraint {
113
113
Constraints : []Constraint {
114
114
{GVK : & GVKConstraint {Group : "bazs.example.com" , Kind : "Baz" , Version : "v1alpha1" }},
115
115
},
@@ -132,7 +132,7 @@ func TestParse(t *testing.T) {
132
132
{
133
133
name : "Invalid/UnknownField" ,
134
134
input : json .RawMessage (
135
- `{"message ": "something", "arbitrary": {"key": "value"}}` ,
135
+ `{"failureMessage ": "something", "arbitrary": {"key": "value"}}` ,
136
136
),
137
137
expError : `json: unknown field "arbitrary"` ,
138
138
},
@@ -153,7 +153,7 @@ func TestParse(t *testing.T) {
153
153
154
154
const (
155
155
inputBasicGVK = `{
156
- "message ": "blah",
156
+ "failureMessage ": "blah",
157
157
"gvk": {
158
158
"group": "example.com",
159
159
"version": "v1",
@@ -162,19 +162,19 @@ const (
162
162
}`
163
163
164
164
inputBasicPackage = `{
165
- "message ": "blah",
165
+ "failureMessage ": "blah",
166
166
"package": {
167
167
"packageName": "foo",
168
168
"versionRange": ">=1.0.0"
169
169
}
170
170
}`
171
171
172
172
inputBasicCompoundTmpl = `{
173
- "message ": "blah",
173
+ "failureMessage ": "blah",
174
174
"%s": {
175
175
"constraints": [
176
176
{
177
- "message ": "blah blah",
177
+ "failureMessage ": "blah blah",
178
178
"package": {
179
179
"packageName": "fuz",
180
180
"versionRange": ">=1.0.0"
@@ -185,7 +185,7 @@ const (
185
185
`
186
186
187
187
inputComplex = `{
188
- "message ": "blah",
188
+ "failureMessage ": "blah",
189
189
"all": {
190
190
"constraints": [
191
191
{
@@ -202,7 +202,7 @@ const (
202
202
}
203
203
},
204
204
{
205
- "message ": "foo and buf must be stable versions",
205
+ "failureMessage ": "foo and buf must be stable versions",
206
206
"all": {
207
207
"constraints": [
208
208
{
@@ -228,7 +228,7 @@ const (
228
228
}
229
229
},
230
230
{
231
- "message ": "blah blah",
231
+ "failureMessage ": "blah blah",
232
232
"any": {
233
233
"constraints": [
234
234
{
@@ -256,7 +256,7 @@ const (
256
256
}
257
257
},
258
258
{
259
- "none ": {
259
+ "not ": {
260
260
"constraints": [
261
261
{
262
262
"gvk": {
0 commit comments