This commit is contained in:
Mohamed Karray
2018-10-08 14:15:06 +02:00
73 changed files with 2720 additions and 20836 deletions

View File

@@ -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 {

View File

@@ -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 ---------------------------------------------------------

View File

@@ -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"));
}
}