mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
remove the rest/ path from endpoints
This commit is contained in:
@@ -107,7 +107,7 @@ public class SecurityFilterTest {
|
||||
*/
|
||||
@Test
|
||||
public void testDoOnAuthenticationUrlV1() throws IOException, ServletException {
|
||||
checkIfAuthenticationUrlIsPassedThrough("/scm/api/rest/auth/access_token");
|
||||
checkIfAuthenticationUrlIsPassedThrough("/scm/api/auth/access_token");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,7 +118,7 @@ public class SecurityFilterTest {
|
||||
*/
|
||||
@Test
|
||||
public void testDoOnAuthenticationUrlV2() throws IOException, ServletException {
|
||||
checkIfAuthenticationUrlIsPassedThrough("/scm/api/rest/v2/auth/access_token");
|
||||
checkIfAuthenticationUrlIsPassedThrough("/scm/api/v2/auth/access_token");
|
||||
}
|
||||
|
||||
private void checkIfAuthenticationUrlIsPassedThrough(String uri) throws IOException, ServletException {
|
||||
|
||||
@@ -78,7 +78,7 @@ public final class IntegrationTestUtil
|
||||
public static final String BASE_URL = "http://localhost:8081/scm/";
|
||||
|
||||
/** scm-manager base url for the rest api */
|
||||
public static final String REST_BASE_URL = BASE_URL.concat("api/rest/v2/");
|
||||
public static final String REST_BASE_URL = BASE_URL.concat("api/v2/");
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public class SecurityRequestsTest {
|
||||
|
||||
@Test
|
||||
public void testIsAuthenticationRequestWithContextPath() {
|
||||
when(request.getRequestURI()).thenReturn("/scm/api/rest/auth/access_token");
|
||||
when(request.getRequestURI()).thenReturn("/scm/api/auth/access_token");
|
||||
when(request.getContextPath()).thenReturn("/scm");
|
||||
|
||||
assertTrue(SecurityRequests.isAuthenticationRequest(request));
|
||||
@@ -29,9 +29,9 @@ public class SecurityRequestsTest {
|
||||
|
||||
@Test
|
||||
public void testIsAuthenticationRequest() throws Exception {
|
||||
assertTrue(SecurityRequests.isAuthenticationRequest("/api/rest/auth/access_token"));
|
||||
assertTrue(SecurityRequests.isAuthenticationRequest("/api/rest/v2/auth/access_token"));
|
||||
assertFalse(SecurityRequests.isAuthenticationRequest("/api/rest/repositories"));
|
||||
assertFalse(SecurityRequests.isAuthenticationRequest("/api/rest/v2/repositories"));
|
||||
assertTrue(SecurityRequests.isAuthenticationRequest("/api/auth/access_token"));
|
||||
assertTrue(SecurityRequests.isAuthenticationRequest("/api/v2/auth/access_token"));
|
||||
assertFalse(SecurityRequests.isAuthenticationRequest("/api/repositories"));
|
||||
assertFalse(SecurityRequests.isAuthenticationRequest("/api/v2/repositories"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user