Skip to content

Commit

Permalink
Removes unused get/post/put cache endpoint (#4761)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <dxho@amazon.com>
  • Loading branch information
derek-ho authored Oct 1, 2024
1 parent 3ad09c8 commit 0a9addb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,11 @@ private void verifyAuthInfoApi(final TestRestClient client) throws Exception {

@Test
public void flushCache() throws Exception {
withUser(NEW_USER, client -> {
forbidden(() -> client.get(apiPath("cache")));
forbidden(() -> client.postJson(apiPath("cache"), EMPTY_BODY));
forbidden(() -> client.putJson(apiPath("cache"), EMPTY_BODY));
forbidden(() -> client.delete(apiPath("cache")));
});
withUser(NEW_USER, client -> { forbidden(() -> client.delete(apiPath("cache"))); });
withUser(ADMIN_USER_NAME, localCluster.getAdminCertificate(), client -> {
notImplemented(() -> client.get(apiPath("cache")));
notImplemented(() -> client.postJson(apiPath("cache"), EMPTY_BODY));
notImplemented(() -> client.putJson(apiPath("cache"), EMPTY_BODY));
methodNotAllowed(() -> client.get(apiPath("cache")));
methodNotAllowed(() -> client.postJson(apiPath("cache"), EMPTY_BODY));
methodNotAllowed(() -> client.putJson(apiPath("cache"), EMPTY_BODY));
final var response = ok(() -> client.delete(apiPath("cache")));
assertThat(response.getBody(), response.getTextFromJsonBody("/message"), is("Cache flushed successfully."));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,7 @@ public class FlushCacheApiAction extends AbstractApiAction {

private final static Logger LOGGER = LogManager.getLogger(FlushCacheApiAction.class);

private static final List<Route> routes = addRoutesPrefix(
ImmutableList.of(
new Route(Method.DELETE, "/cache"),
new Route(Method.GET, "/cache"),
new Route(Method.PUT, "/cache"),
new Route(Method.POST, "/cache")
)
);
private static final List<Route> routes = addRoutesPrefix(ImmutableList.of(new Route(Method.DELETE, "/cache")));

@Inject
public FlushCacheApiAction(
Expand Down

0 comments on commit 0a9addb

Please sign in to comment.