|
1 | 1 | package io.javaoperatorsdk.operator.api.reconciler.dependent.managed;
|
2 | 2 |
|
3 |
| -import java.util.List; |
4 |
| -import java.util.Map; |
5 | 3 | import java.util.Optional;
|
6 | 4 |
|
7 | 5 | import org.junit.jupiter.api.Test;
|
8 | 6 |
|
9 |
| -import io.javaoperatorsdk.operator.processing.dependent.workflow.WorkflowReconcileResult; |
10 |
| - |
11 |
| -import static io.javaoperatorsdk.operator.api.reconciler.dependent.managed.DefaultManagedDependentResourceContext.RECONCILE_RESULT_KEY; |
12 | 7 | import static org.assertj.core.api.Assertions.assertThat;
|
13 | 8 | import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
14 | 9 |
|
15 | 10 | class DefaultManagedDependentResourceContextTest {
|
16 | 11 |
|
17 |
| - private final ManagedDependentResourceContext context = |
18 |
| - new DefaultManagedDependentResourceContext(); |
| 12 | + private final ManagedWorkflowAndDependentResourceContext context = |
| 13 | + new DefaultManagedWorkflowAndDependentResourceContext<>(null, null, null); |
19 | 14 |
|
20 | 15 | @Test
|
21 | 16 | void getWhenEmpty() {
|
@@ -50,7 +45,7 @@ void putNewValueReturnsPriorValue() {
|
50 | 45 | void putNewValueLogsWarningIfTypesDiffer() {
|
51 | 46 | // to check that we properly log things without setting up a complex fixture
|
52 | 47 | final String[] messages = new String[1];
|
53 |
| - var context = new DefaultManagedDependentResourceContext() { |
| 48 | + var context = new DefaultManagedWorkflowAndDependentResourceContext<>(null, null, null) { |
54 | 49 | @Override
|
55 | 50 | void logWarning(String message) {
|
56 | 51 | messages[0] = message;
|
@@ -93,13 +88,4 @@ void getMandatoryWhenEmpty() {
|
93 | 88 | .hasMessage(
|
94 | 89 | "Mandatory attribute (key: key, type: java.lang.String) is missing or not of the expected type");
|
95 | 90 | }
|
96 |
| - |
97 |
| - @Test |
98 |
| - void getWorkflowReconcileResult() { |
99 |
| - WorkflowReconcileResult result = |
100 |
| - new WorkflowReconcileResult(List.of(), List.of(), Map.of(), Map.of()); |
101 |
| - context.put(RECONCILE_RESULT_KEY, result); |
102 |
| - Optional<WorkflowReconcileResult> actual = context.getWorkflowReconcileResult(); |
103 |
| - assertThat(actual).containsSame(result); |
104 |
| - } |
105 | 91 | }
|
0 commit comments