Move oauth2 admin service path (closed #544)
Change-Id: I59cc7139448297b4a1e0a551ac0879d96f13822c
diff --git a/full/Changes b/full/Changes
index 7948154..0b1e34e 100644
--- a/full/Changes
+++ b/full/Changes
@@ -2,7 +2,7 @@
- Moved the service path of VC admin services to admin/vc (closed #543)
- Added an admin service to load and cache system vc (solved #268)
-
+- Move oauth2 admin service path (closed #544)
# version 0.69.2
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2AdminController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2AdminController.java
index 0ca1368..957d31b 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2AdminController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2AdminController.java
@@ -19,7 +19,7 @@
import de.ids_mannheim.korap.web.utils.ResourceFilters;
@Controller
-@Path("{version}/oauth2/admin")
+@Path("{version}/admin/oauth2")
@ResourceFilters({ APIVersionFilter.class, AdminFilter.class })
@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
public class OAuth2AdminController {
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java
index 42431c8..75e29e6 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java
@@ -46,8 +46,8 @@
Form form)
throws ProcessingException,
KustvaktException {
- Response response = target().path(API_VERSION).path("oauth2")
- .path("admin").path("client").path("privilege")
+ Response response = target().path(API_VERSION).path("admin")
+ .path("oauth2").path("client").path("privilege")
.request()
.header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
.createBasicAuthorizationHeaderValue(username, "pass"))
@@ -67,8 +67,8 @@
form.param("super", Boolean.toString(false));
form.param("token", "secret"); //adminToken
- Response response = target().path(API_VERSION).path("oauth2")
- .path("admin").path("client").path("privilege")
+ Response response = target().path(API_VERSION).path("admin")
+ .path("oauth2").path("client").path("privilege")
.request()
.header(HttpHeaders.CONTENT_TYPE,
ContentType.APPLICATION_FORM_URLENCODED)
@@ -99,7 +99,7 @@
Form form = new Form();
form.param("token", "secret");
- target().path(API_VERSION).path("oauth2").path("admin").path("token")
+ target().path(API_VERSION).path("admin").path("oauth2").path("token")
.path("clean")
.request()
.post(Entity.form(form));
@@ -125,7 +125,7 @@
int accessTokensAfter = accessDao.retrieveInvalidAccessTokens().size();
assertEquals(accessTokensAfter, accessTokensBefore + 1);
- target().path(API_VERSION).path("oauth2").path("admin").path("token")
+ target().path(API_VERSION).path("admin").path("oauth2").path("token")
.path("clean")
.request()
.header(Attributes.AUTHORIZATION, adminAuthHeader)