File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed
src/test/java/io/javaoperatorsdk/operator/baseapi/simple Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 63
63
<artifactId >openshift-client-api</artifactId >
64
64
<scope >test</scope >
65
65
</dependency >
66
+ <dependency >
67
+ <groupId >io.fabric8</groupId >
68
+ <artifactId >crd-generator-api-v2</artifactId >
69
+ <scope >test</scope >
70
+ </dependency >
71
+
66
72
<dependency >
67
73
<groupId >org.apache.logging.log4j</groupId >
68
74
<artifactId >log4j-slf4j2-impl</artifactId >
Original file line number Diff line number Diff line change 1
1
package io .javaoperatorsdk .operator .baseapi .simple ;
2
2
3
3
import java .time .Duration ;
4
+ import java .util .Map ;
4
5
import java .util .concurrent .TimeUnit ;
5
6
6
7
import org .junit .jupiter .api .Test ;
@@ -24,8 +25,8 @@ void configMapGetsCreatedForTestCustomResource() {
24
25
operator .getReconcilerOfType (TestReconciler .class ).setUpdateStatus (true );
25
26
26
27
TestCustomResource resource = TestUtils .testCustomResource ();
27
- // resource.getSpec()
28
- operator .create (resource );
28
+ resource .getSpec (). setSomeValue ( Map . of ( "key1" , Map . of ( "key2" , "value2" )));
29
+ var res = operator .create (resource );
29
30
30
31
awaitResourcesCreatedOrUpdated ();
31
32
awaitStatusUpdated ();
Original file line number Diff line number Diff line change 1
1
package io .javaoperatorsdk .operator .baseapi .simple ;
2
2
3
- import com . fasterxml . jackson . annotation . JsonAnyGetter ;
4
- import com . fasterxml . jackson . annotation . JsonAnySetter ;
5
- import com . fasterxml . jackson . databind . JsonNode ;
3
+ import java . util . Map ;
4
+
5
+ import io . fabric8 . crd . generator . annotation . PreserveUnknownFields ;
6
6
7
7
public class TestCustomResourceSpec {
8
8
@@ -12,15 +12,13 @@ public class TestCustomResourceSpec {
12
12
13
13
private String value ;
14
14
15
- private JsonNode someValue ;
15
+ @ PreserveUnknownFields private Map < String , Object > someValue ;
16
16
17
- @ JsonAnyGetter
18
- public JsonNode getSomeValue () {
17
+ public Map <String , Object > getSomeValue () {
19
18
return someValue ;
20
19
}
21
20
22
- @ JsonAnySetter
23
- public void setSomeValue (JsonNode value ) {
21
+ public void setSomeValue (Map <String , Object > value ) {
24
22
this .someValue = value ;
25
23
}
26
24
You can’t perform that action at this time.
0 commit comments