use of org.bf2.operator.operands.OperandReadiness in project kas-fleetshard by bf2fc6cc711aee1a0c2a.
the class KafkaClusterTest method pausedUnknownStatus.
@Test
void pausedUnknownStatus() throws InterruptedException {
ManagedKafka mk = ManagedKafka.getDummyInstance(1);
InformerManager informer = Mockito.mock(InformerManager.class);
Kafka kafka = new KafkaBuilder(this.kafkaCluster.kafkaFrom(mk, null)).editMetadata().withAnnotations(Map.of(StrimziManager.STRIMZI_PAUSE_REASON_ANNOTATION, "custom")).endMetadata().withNewStatus().withConditions(new ConditionBuilder().withType("ReconciliationPaused").withStatus("True").build()).endStatus().build();
Mockito.when(informer.getLocalKafka(Mockito.anyString(), Mockito.anyString())).thenReturn(kafka);
QuarkusMock.installMockForType(informer, InformerManager.class);
OperandReadiness readiness = this.kafkaCluster.getReadiness(mk);
assertEquals(Status.Unknown, readiness.getStatus());
assertEquals(Reason.Paused, readiness.getReason());
assertEquals("Kafka mk-1 is paused for an unknown reason", readiness.getMessage());
}
Aggregations