Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions operator-framework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
<artifactId>openshift-client-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>crd-generator-api-v2</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.javaoperatorsdk.operator.baseapi.simple;

import java.time.Duration;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import org.junit.jupiter.api.Test;
Expand All @@ -10,6 +11,8 @@
import io.javaoperatorsdk.operator.junit.LocallyRunOperatorExtension;
import io.javaoperatorsdk.operator.support.TestUtils;

import com.fasterxml.jackson.databind.ObjectMapper;

import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;

Expand All @@ -21,10 +24,12 @@ class ReconcilerExecutorIT {

@Test
void configMapGetsCreatedForTestCustomResource() {
var om = new ObjectMapper();
operator.getReconcilerOfType(TestReconciler.class).setUpdateStatus(true);

TestCustomResource resource = TestUtils.testCustomResource();
operator.create(resource);
resource.getSpec().setSomeValue(om.valueToTree(Map.of("k", "v")));
var res = operator.create(resource);

awaitResourcesCreatedOrUpdated();
awaitStatusUpdated();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.javaoperatorsdk.operator.baseapi.simple;

import com.fasterxml.jackson.databind.JsonNode;

public class TestCustomResourceSpec {

private String configMapName;
Expand All @@ -8,6 +10,16 @@ public class TestCustomResourceSpec {

private String value;

private JsonNode someValue;

public JsonNode getSomeValue() {
return someValue;
}

public void setSomeValue(JsonNode value) {
this.someValue = value;
}

public String getConfigMapName() {
return configMapName;
}
Expand Down