Skip to content

Commit

Permalink
feat: removed application deletion (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordenReuter authored Nov 22, 2024
1 parent d6de909 commit 24006d8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down
25 changes: 0 additions & 25 deletions src/main/openapi/openapi-bff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
}

0 comments on commit 24006d8

Please sign in to comment.