From 24006d821cc8aaf89ac1e843a79023cd4be9dc33 Mon Sep 17 00:00:00 2001 From: JordenReuter <149687553+JordenReuter@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:12:10 +0100 Subject: [PATCH] feat: removed application deletion (#91) --- .../ApplicationRestController.java | 7 ------ src/main/openapi/openapi-bff.yaml | 25 ------------------- .../rs/ApplicationRestControllerTest.java | 24 ++---------------- 3 files changed, 2 insertions(+), 54 deletions(-) diff --git a/src/main/java/org/tkit/onecx/permission/bff/rs/controllers/ApplicationRestController.java b/src/main/java/org/tkit/onecx/permission/bff/rs/controllers/ApplicationRestController.java index e00c664..a052bbd 100644 --- a/src/main/java/org/tkit/onecx/permission/bff/rs/controllers/ApplicationRestController.java +++ b/src/main/java/org/tkit/onecx/permission/bff/rs/controllers/ApplicationRestController.java @@ -29,13 +29,6 @@ public class ApplicationRestController implements ApplicationApiService { @Inject ApplicationMapper mapper; - @Override - public Response deleteByApplicationName(String name) { - try (Response response = applicationClient.deleteByApplicationName(name)) { - return Response.status(response.getStatus()).build(); - } - } - @Override public Response searchApplications(ApplicationSearchCriteriaDTO applicationSearchCriteriaDTO) { try (Response response = applicationClient.searchApplications(mapper.map(applicationSearchCriteriaDTO))) { diff --git a/src/main/openapi/openapi-bff.yaml b/src/main/openapi/openapi-bff.yaml index 21793be..bc8eb69 100644 --- a/src/main/openapi/openapi-bff.yaml +++ b/src/main/openapi/openapi-bff.yaml @@ -690,31 +690,6 @@ paths: application/json: schema: $ref: '#/components/schemas/ProblemDetailResponse' - /applications/{name}: - delete: - x-onecx: - permissions: - application: - - delete - tags: - - application - description: delete application by name - operationId: deleteByApplicationName - parameters: - - name: name - in: path - required: true - schema: - type: string - responses: - 204: - description: Application deleted - 400: - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetailResponse' /workspaces/search: post: x-onecx: diff --git a/src/test/java/org/tkit/onecx/permission/rs/ApplicationRestControllerTest.java b/src/test/java/org/tkit/onecx/permission/rs/ApplicationRestControllerTest.java index 7aff3e8..7ff6c39 100644 --- a/src/test/java/org/tkit/onecx/permission/rs/ApplicationRestControllerTest.java +++ b/src/test/java/org/tkit/onecx/permission/rs/ApplicationRestControllerTest.java @@ -60,7 +60,7 @@ void searchApplicationByCriteriaTest() { .header(APM_HEADER_PARAM, ADMIN) .contentType(APPLICATION_JSON) .body(criteriaDTO) - .post("/search") + .post() .then() .statusCode(Response.Status.OK.getStatusCode()) .contentType(APPLICATION_JSON) @@ -95,30 +95,10 @@ void searchApplicationsByEmptyCriteriaTest() { .header(APM_HEADER_PARAM, ADMIN) .contentType(APPLICATION_JSON) .body(criteriaDTO) - .post("/search") + .post() .then() .statusCode(Response.Status.BAD_REQUEST.getStatusCode()); mockServerClient.clear(MOCKID); } - - @Test - void deleteApplicationByName() { - - // create mock rest endpoint - mockServerClient.when(request().withPath("/internal/applications/testApp").withMethod(HttpMethod.DELETE)).withId(MOCKID) - .respond(httpRequest -> response().withStatusCode(Response.Status.NO_CONTENT.getStatusCode())); - - given() - .when() - .auth().oauth2(keycloakClient.getAccessToken(ADMIN)) - .header(APM_HEADER_PARAM, ADMIN) - .contentType(APPLICATION_JSON) - .pathParam("name", "testApp") - .delete("/{name}") - .then() - .statusCode(Response.Status.NO_CONTENT.getStatusCode()); - - mockServerClient.clear(MOCKID); - } }