use of org.bf2.operator.managers.OperandOverrideManager in project kas-fleetshard by bf2fc6cc711aee1a0c2a.
the class AdminServerTest method createAdminServerDeployment.
@ParameterizedTest
@CsvSource({ "test-mk-q, 1, true, false, /expected/adminserver-quarkus.yml", "test-mk-tls-q, 2, true, true, /expected/adminserver-tls-quarkus.yml", "test-mk, 3, false, false, /expected/adminserver.yml", "test-mk-tls, 4, false, true, /expected/adminserver-tls.yml" })
void createAdminServerDeployment(String name, String versionString, boolean quarkusBased, boolean tls, String expectedResource) throws Exception {
ManagedKafka mk = buildBasicManagedKafka(name, versionString, tls ? new TlsKeyPair() : null);
OperandOverride override = new OperandOverride();
override.setImage("quay.io/mk-ci-cd/kafka-admin-api:0.7.0");
override.setAdditionalProperty("quarkus-based", quarkusBased);
OperandOverrideManager overrideManager = Mockito.mock(OperandOverrideManager.class);
Mockito.when(overrideManager.getAdminServerOverride(versionString)).thenReturn(override);
Mockito.when(overrideManager.getAdminServerImage(versionString)).thenReturn(override.image);
QuarkusMock.installMockForType(overrideManager, OperandOverrideManager.class);
Deployment adminServerDeployment = adminServer.deploymentFrom(mk, null);
server.getClient().apps().deployments().create(adminServerDeployment);
assertNotNull(server.getClient().apps().deployments().inNamespace(adminServerDeployment.getMetadata().getNamespace()).withName(adminServerDeployment.getMetadata().getName()).get());
KafkaClusterTest.diffToExpected(adminServerDeployment, expectedResource);
}
Aggregations