use of org.bf2.cos.fleetshard.api.ManagedConnectorOperatorSpecBuilder in project cos-fleetshard by bf2fc6cc711aee1a0c2a.
the class ManagedConnectorOperatorSteps method a_managedConnectorOperator.
@Given("^a ManagedConnectorOperator with:$")
public void a_managedConnectorOperator(Map<String, String> entry) {
final String operatorId = entry.getOrDefault("operator.id", uid());
final String operatorType = entry.get("operator.type");
final String operatorVersion = entry.get("operator.version");
final String operatorRuntime = entry.get("operator.runtime");
var connector = new ManagedConnectorOperatorBuilder().withMetadata(new ObjectMetaBuilder().withName(operatorId).addToLabels(Resources.LABEL_OPERATOR_TYPE, operatorType).addToLabels(Resources.LABEL_OPERATOR_VERSION, operatorVersion).build()).withSpec(new ManagedConnectorOperatorSpecBuilder().withVersion(operatorVersion).withType(operatorType).withRuntime(operatorRuntime).build()).build();
ctx.managedConnectorOperator(connector);
}
use of org.bf2.cos.fleetshard.api.ManagedConnectorOperatorSpecBuilder in project cos-fleetshard by bf2fc6cc711aee1a0c2a.
the class ClusterStatusUpdaterWithOperatorTest method statusIsUpdated.
@Test
void statusIsUpdated() {
final String statusUrl = "/api/connector_mgmt/v1/agent/kafka_connector_clusters/" + config.cluster().id() + "/status";
final String operatorId = uid();
kubernetesClient.resources(ManagedConnectorOperator.class).inNamespace(ns).create(new ManagedConnectorOperatorBuilder().withNewMetadata().withName(operatorId).endMetadata().withSpec(new ManagedConnectorOperatorSpecBuilder().withType("operator-type").withVersion("999").withRuntime("operator-runtime").build()).build());
RestAssured.given().contentType(MediaType.TEXT_PLAIN).post("/test/provisioner/all");
untilAsserted(() -> {
server.verify(putRequestedFor(urlEqualTo(statusUrl)).withHeader(ContentTypeHeader.KEY, equalTo(APPLICATION_JSON)).withRequestBody(jp("$.phase", "ready")).withRequestBody(jp("$.operators.size()", "1")).withRequestBody(jp("$.operators[0].namespace", ns)).withRequestBody(jp("$.operators[0].status", "ready")).withRequestBody(jp("$.operators[0].operator.id", operatorId)).withRequestBody(jp("$.operators[0].operator.type", "operator-type")).withRequestBody(jp("$.operators[0].operator.version", "999")));
});
}
Aggregations