Skip to content

Commit 4407423

Browse files
committed
Add tests for Delete Stream API
1 parent 3832360 commit 4407423

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

src/test/java/io/quarkus/registry/app/admin/AdminApiTest.java

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void setUp() {
130130
@Test
131131
void unauthenticated_requests_should_forbid_access() {
132132
given().body(
133-
"{ \"artifact\":\"aaaa\",\"artifactId\": \"string\", \"description\": \"string\", \"groupId\": \"messging\", \"metadata\": {}, \"name\": \"string\",\"origins\": [ { \"id\": \"string\", \"platform\": false } ], \"version\": \"string\"}")
133+
"{ \"artifact\":\"aaaa\",\"artifactId\": \"string\", \"description\": \"string\", \"groupId\": \"messging\", \"metadata\": {}, \"name\": \"string\",\"origins\": [ { \"id\": \"string\", \"platform\": false } ], \"version\": \"string\"}")
134134
.post("/admin/v1/extension")
135135
.then()
136136
.statusCode(HttpURLConnection.HTTP_FORBIDDEN);
@@ -225,8 +225,8 @@ void validate_long_input() {
225225
void delete_extension() {
226226
// Delete extension version
227227
given().formParams("groupId", "delete",
228-
"artifactId", "me",
229-
"version", "1.1.0")
228+
"artifactId", "me",
229+
"version", "1.1.0")
230230
.header("Token", "test")
231231
.delete("/admin/v1/extension")
232232
.then()
@@ -242,7 +242,7 @@ void delete_extension() {
242242

243243
// Delete extension
244244
given().formParams("groupId", "delete",
245-
"artifactId", "me")
245+
"artifactId", "me")
246246
.header("Token", "test")
247247
.delete("/admin/v1/extension")
248248
.then()
@@ -261,8 +261,8 @@ void delete_extension() {
261261
void should_not_delete_extension_release_from_platform() {
262262
// Should not delete an extension release if it belongs to a platform
263263
given().formParams("groupId", "delete-platform-groupId",
264-
"artifactId", "delete-platform-artifactId",
265-
"version", "1.0.0")
264+
"artifactId", "delete-platform-artifactId",
265+
"version", "1.0.0")
266266
.header("Token", "test")
267267
.delete("/admin/v1/extension")
268268
.then()
@@ -273,7 +273,7 @@ void should_not_delete_extension_release_from_platform() {
273273
void should_not_delete_extension_from_platform() {
274274
// Should not delete an extension if any release belongs to a platform
275275
given().formParams("groupId", "delete-platform-groupId",
276-
"artifactId", "delete-platform-artifactId")
276+
"artifactId", "delete-platform-artifactId")
277277
.header("Token", "test")
278278
.delete("/admin/v1/extension")
279279
.then()
@@ -312,7 +312,7 @@ void should_honor_unlisted_platform_stream_flag() {
312312
void delete_extension_catalog() {
313313
// Delete extension version
314314
given().formParams("platformKey", "io.quarkus.platform",
315-
"version", "10.0.0.Final")
315+
"version", "10.0.0.Final")
316316
.header("Token", "test")
317317
.delete("/admin/v1/extension/catalog")
318318
.then()
@@ -427,4 +427,22 @@ void patch_platform_stream_lts() throws IOException {
427427
.body("platforms[0].streams.find{it.id = '10.0'}.lts", is(true));
428428

429429
}
430+
431+
@Test
432+
void delete_platform_stream() {
433+
// Delete platform stream
434+
given()
435+
.header("Token", "test")
436+
.delete("/admin/v1/stream/io.quarkus.platform/10.0")
437+
.then()
438+
.statusCode(HttpURLConnection.HTTP_ACCEPTED);
439+
440+
given()
441+
.get("/client/platforms/all")
442+
.then()
443+
.statusCode(HttpURLConnection.HTTP_OK)
444+
.contentType(ContentType.JSON)
445+
.body("platforms[0].streams", hasSize(1),
446+
"platforms[0].current-stream-id", is("9.0"));
447+
}
430448
}

0 commit comments

Comments
 (0)