Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Commit

Permalink
BC-7239 - test 3
Browse files Browse the repository at this point in the history
  • Loading branch information
mamutmk5 authored Jun 21, 2024
1 parent 2a10a98 commit d7bb066
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/test/java/de/svs/doido/mongo/ConfigmapApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
import io.fabric8.kubernetes.api.model.ConfigMap;
import io.fabric8.kubernetes.api.model.ConfigMapList;
import io.fabric8.kubernetes.api.model.ConfigMapBuilder;
import io.fabric8.kubernetes.api.model.ObjectMeta;

import java.util.Map;
import java.util.HashMap;

import static io.restassured.RestAssured.given;
Expand Down Expand Up @@ -84,5 +86,22 @@ void testInteractionWithPostConfigmapsExistAndNoLabels() {
.then()
.statusCode(403);
}


@Test
void testInteractionWithPostConfigmapsExistAndLabels() {
ConfigMap configmap = new ConfigMapBuilder().withNewMetadata().withName("test3").withNamespace("namespaceA").and().build();
Map<String,String> labels = new HashMap<>();
ObjectMeta meta;
labels.put("app.kubernetes.io/name", "doido-mongo");
meta = configmap.getMetadata();
meta.setLabels(labels);
configmap.setMetadata(meta);
client.configMaps().create(configmap);
given()
.when().post("/configmap/namespaceA/test3")
.then()
.statusCode(204);
}

}

0 comments on commit d7bb066

Please sign in to comment.