use of io.strimzi.api.kafka.model.status.KafkaConnectorStatusBuilder in project cos-fleetshard by bf2fc6cc711aee1a0c2a.
the class DebeziumOperandControllerTest method computeStatus.
@ParameterizedTest
@MethodSource
void computeStatus(String connectorState, String conditionType, String conditionReason, String expectedConnectorState) {
ConnectorStatusSpec status = new ConnectorStatusSpec();
DebeziumOperandSupport.computeStatus(status, new KafkaConnectorBuilder().withStatus(new KafkaConnectorStatusBuilder().addToConditions(new ConditionBuilder().withType(conditionType).withReason(conditionReason).build()).addToConnectorStatus("connector", new org.bf2.cos.fleetshard.operator.debezium.model.KafkaConnectorStatusBuilder().withState(connectorState).build()).build()).build());
assertThat(status.getPhase()).isEqualTo(expectedConnectorState);
assertThat(status.getConditions()).anySatisfy(condition -> {
assertThat(condition).hasFieldOrPropertyWithValue("type", conditionType).hasFieldOrPropertyWithValue("reason", conditionReason);
});
}
Aggregations