use of io.strimzi.api.kafka.model.status.KafkaConnectStatusBuilder in project cos-fleetshard by bf2fc6cc711aee1a0c2a.
the class DebeziumOperandControllerTest method computeStatus.
@ParameterizedTest
@MethodSource
void computeStatus(String connectorState, List<Condition> connectorConditions, List<Condition> connectConditions, String expectedManagedConnectorState, String expectedReason) {
ConnectorStatusSpec status = new ConnectorStatusSpec();
DebeziumOperandSupport.computeStatus(status, new KafkaConnectBuilder().withStatus(new KafkaConnectStatusBuilder().addAllToConditions(connectConditions).build()).build(), new KafkaConnectorBuilder().withStatus(new KafkaConnectorStatusBuilder().addAllToConditions(connectorConditions).addToConnectorStatus("connector", new org.bf2.cos.fleetshard.operator.debezium.model.KafkaConnectorStatusBuilder().withState(connectorState).build()).build()).build());
assertThat(status.getPhase()).isEqualTo(expectedManagedConnectorState);
assertThat(status.getConditions()).anySatisfy(condition -> assertThat(condition).hasFieldOrPropertyWithValue("type", "Ready").hasFieldOrPropertyWithValue("status", null == expectedReason ? "True" : "False").hasFieldOrPropertyWithValue("reason", expectedReason));
}
Aggregations