File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/simple Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 11
11
import io .javaoperatorsdk .operator .junit .LocallyRunOperatorExtension ;
12
12
import io .javaoperatorsdk .operator .support .TestUtils ;
13
13
14
+ import com .fasterxml .jackson .databind .ObjectMapper ;
15
+
14
16
import static org .assertj .core .api .Assertions .assertThat ;
15
17
import static org .awaitility .Awaitility .await ;
16
18
@@ -22,10 +24,11 @@ class ReconcilerExecutorIT {
22
24
23
25
@ Test
24
26
void configMapGetsCreatedForTestCustomResource () {
27
+ var om = new ObjectMapper ();
25
28
operator .getReconcilerOfType (TestReconciler .class ).setUpdateStatus (true );
26
29
27
30
TestCustomResource resource = TestUtils .testCustomResource ();
28
- resource .getSpec ().setSomeValue (Map . of ( "key1" , Map .of ("key2 " , "value2 " )));
31
+ resource .getSpec ().setSomeValue (om . valueToTree ( Map .of ("k " , "v " )));
29
32
var res = operator .create (resource );
30
33
31
34
awaitResourcesCreatedOrUpdated ();
Original file line number Diff line number Diff line change 1
1
package io .javaoperatorsdk .operator .baseapi .simple ;
2
2
3
- import java .util .Map ;
4
-
5
- import io .fabric8 .crd .generator .annotation .PreserveUnknownFields ;
3
+ import com .fasterxml .jackson .databind .JsonNode ;
6
4
7
5
public class TestCustomResourceSpec {
8
6
@@ -12,13 +10,13 @@ public class TestCustomResourceSpec {
12
10
13
11
private String value ;
14
12
15
- @ PreserveUnknownFields private Map < String , Object > someValue ;
13
+ private JsonNode someValue ;
16
14
17
- public Map < String , Object > getSomeValue () {
15
+ public JsonNode getSomeValue () {
18
16
return someValue ;
19
17
}
20
18
21
- public void setSomeValue (Map < String , Object > value ) {
19
+ public void setSomeValue (JsonNode value ) {
22
20
this .someValue = value ;
23
21
}
24
22
You can’t perform that action at this time.
0 commit comments