@@ -15,7 +15,7 @@ public class V1CustomResourceDefinitionConvertTest
15
15
[ Fact ]
16
16
public void Should_Correctly_Translate_CRD ( )
17
17
{
18
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
18
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
19
19
var ced = CustomEntityDefinitionExtensions . CreateResourceDefinition ( _testSpecEntity ) ;
20
20
21
21
crd . Kind . Should ( ) . Be ( V1CustomResourceDefinition . KubeKind ) ;
@@ -30,14 +30,14 @@ public void Should_Correctly_Translate_CRD()
30
30
[ Fact ]
31
31
public void Should_Add_Status_SubResource_If_Present ( )
32
32
{
33
- var crd = EntityToCrdExtensions . CreateCrd ( _testStatusEntity ) . Convert ( ) ;
33
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testStatusEntity ) ;
34
34
crd . Spec . Subresources . Status . Should ( ) . NotBeNull ( ) ;
35
35
}
36
36
37
37
[ Fact ]
38
38
public void Should_Not_Add_Status_SubResource_If_Absent ( )
39
39
{
40
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
40
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
41
41
crd . Spec . Subresources ? . Status ? . Should ( ) . BeNull ( ) ;
42
42
}
43
43
@@ -52,7 +52,7 @@ public void Should_Not_Add_Status_SubResource_If_Absent()
52
52
[ InlineData ( "Enum" , "string" , null ) ]
53
53
public void Should_Set_The_Correct_Type_And_Format_For_Types ( string fieldName , string typeName , string ? format )
54
54
{
55
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
55
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
56
56
57
57
var specProperties = crd . Spec . Validation . OpenAPIV3Schema . Properties [ "spec" ] ;
58
58
specProperties . Type . Should ( ) . Be ( "object" ) ;
@@ -71,7 +71,7 @@ public void Should_Set_The_Correct_Type_And_Format_For_Types(string fieldName, s
71
71
[ Fact ]
72
72
public void Should_Set_The_Correct_Array_Type ( )
73
73
{
74
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
74
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
75
75
var specProperties = crd . Spec . Validation . OpenAPIV3Schema . Properties [ "spec" ] ;
76
76
77
77
var normalField = specProperties . Properties [ "stringArray" ] ;
@@ -88,7 +88,7 @@ public void Should_Set_The_Correct_Array_Type()
88
88
[ Fact ]
89
89
public void Should_Set_Description_On_Class ( )
90
90
{
91
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
91
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
92
92
93
93
var specProperties = crd . Spec . Validation . OpenAPIV3Schema . Properties [ "spec" ] ;
94
94
specProperties . Description . Should ( ) . NotBe ( "" ) ;
@@ -97,7 +97,7 @@ public void Should_Set_Description_On_Class()
97
97
[ Fact ]
98
98
public void Should_Set_Description ( )
99
99
{
100
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
100
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
101
101
102
102
var specProperties = crd . Spec . Validation . OpenAPIV3Schema . Properties [ "spec" ] ;
103
103
var field = specProperties . Properties [ "description" ] ;
@@ -108,7 +108,7 @@ public void Should_Set_Description()
108
108
[ Fact ]
109
109
public void Should_Set_ExternalDocs ( )
110
110
{
111
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
111
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
112
112
113
113
var specProperties = crd . Spec . Validation . OpenAPIV3Schema . Properties [ "spec" ] ;
114
114
var field = specProperties . Properties [ "externalDocs" ] ;
@@ -119,7 +119,7 @@ public void Should_Set_ExternalDocs()
119
119
[ Fact ]
120
120
public void Should_Set_ExternalDocs_Description ( )
121
121
{
122
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
122
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
123
123
124
124
var specProperties = crd . Spec . Validation . OpenAPIV3Schema . Properties [ "spec" ] ;
125
125
var field = specProperties . Properties [ "externalDocsWithDescription" ] ;
@@ -130,7 +130,7 @@ public void Should_Set_ExternalDocs_Description()
130
130
[ Fact ]
131
131
public void Should_Set_Item_Information ( )
132
132
{
133
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
133
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
134
134
135
135
var specProperties = crd . Spec . Validation . OpenAPIV3Schema . Properties [ "spec" ] ;
136
136
var field = specProperties . Properties [ "items" ] ;
@@ -144,7 +144,7 @@ public void Should_Set_Item_Information()
144
144
[ Fact ]
145
145
public void Should_Set_Length_Information ( )
146
146
{
147
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
147
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
148
148
149
149
var specProperties = crd . Spec . Validation . OpenAPIV3Schema . Properties [ "spec" ] ;
150
150
var field = specProperties . Properties [ "length" ] ;
@@ -156,7 +156,7 @@ public void Should_Set_Length_Information()
156
156
[ Fact ]
157
157
public void Should_Set_MultipleOf ( )
158
158
{
159
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
159
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
160
160
161
161
var specProperties = crd . Spec . Validation . OpenAPIV3Schema . Properties [ "spec" ] ;
162
162
var field = specProperties . Properties [ "multipleOf" ] ;
@@ -167,7 +167,7 @@ public void Should_Set_MultipleOf()
167
167
[ Fact ]
168
168
public void Should_Set_Pattern ( )
169
169
{
170
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
170
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
171
171
172
172
var specProperties = crd . Spec . Validation . OpenAPIV3Schema . Properties [ "spec" ] ;
173
173
var field = specProperties . Properties [ "pattern" ] ;
@@ -178,7 +178,7 @@ public void Should_Set_Pattern()
178
178
[ Fact ]
179
179
public void Should_Set_RangeMinimum ( )
180
180
{
181
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
181
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
182
182
183
183
var specProperties = crd . Spec . Validation . OpenAPIV3Schema . Properties [ "spec" ] ;
184
184
var field = specProperties . Properties [ "rangeMinimum" ] ;
@@ -190,7 +190,7 @@ public void Should_Set_RangeMinimum()
190
190
[ Fact ]
191
191
public void Should_Set_RangeMaximum ( )
192
192
{
193
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
193
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
194
194
195
195
var specProperties = crd . Spec . Validation . OpenAPIV3Schema . Properties [ "spec" ] ;
196
196
var field = specProperties . Properties [ "rangeMaximum" ] ;
@@ -202,7 +202,7 @@ public void Should_Set_RangeMaximum()
202
202
[ Fact ]
203
203
public void Should_Set_Required ( )
204
204
{
205
- var crd = EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) . Convert ( ) ;
205
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testSpecEntity ) ;
206
206
207
207
var specProperties = crd . Spec . Validation . OpenAPIV3Schema . Properties [ "spec" ] ;
208
208
specProperties . Required . Should ( ) . Contain ( "required" ) ;
@@ -211,7 +211,7 @@ public void Should_Set_Required()
211
211
[ Fact ]
212
212
public void Should_Set_Required_Null_If_No_Required ( )
213
213
{
214
- var crd = EntityToCrdExtensions . CreateCrd ( _testStatusEntity ) . Convert ( ) ;
214
+ var crd = ( V1beta1CustomResourceDefinition ) EntityToCrdExtensions . CreateCrd ( _testStatusEntity ) ;
215
215
216
216
var specProperties = crd . Spec . Validation . OpenAPIV3Schema . Properties [ "spec" ] ;
217
217
specProperties . Required . Should ( ) . BeNull ( ) ;
0 commit comments