mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
Merged 2.0.0-m3
This commit is contained in:
@@ -4,11 +4,11 @@ import java.net.URI;
|
|||||||
|
|
||||||
public interface ScmPathInfo {
|
public interface ScmPathInfo {
|
||||||
|
|
||||||
String REST_API_PATH = "/api/rest";
|
String REST_API_PATH = "/api";
|
||||||
|
|
||||||
URI getApiRestUri();
|
URI getApiRestUri();
|
||||||
|
|
||||||
default URI getRootUri() {
|
default URI getRootUri() {
|
||||||
return getApiRestUri().resolve("../..");
|
return getApiRestUri().resolve("..");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ public class InitializingHttpScmProtocolWrapperTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private OngoingStubbing<ScmPathInfo> mockSetPathInfo() {
|
private OngoingStubbing<ScmPathInfo> mockSetPathInfo() {
|
||||||
return when(pathInfoStore.get()).thenReturn(() -> URI.create("http://example.com/scm/api/rest/"));
|
return when(pathInfoStore.get()).thenReturn(() -> URI.create("http://example.com/scm/api/"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ package sonia.scm.it;
|
|||||||
import org.apache.http.HttpStatus;
|
import org.apache.http.HttpStatus;
|
||||||
import org.assertj.core.api.Assertions;
|
import org.assertj.core.api.Assertions;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.rules.TemporaryFolder;
|
import org.junit.rules.TemporaryFolder;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import static java.net.URI.create;
|
|||||||
public class RestUtil {
|
public class RestUtil {
|
||||||
|
|
||||||
public static final URI BASE_URL = create("http://localhost:8081/scm/");
|
public static final URI BASE_URL = create("http://localhost:8081/scm/");
|
||||||
public static final URI REST_BASE_URL = BASE_URL.resolve("api/rest/v2/");
|
public static final URI REST_BASE_URL = BASE_URL.resolve("api/v2/");
|
||||||
|
|
||||||
public static URI createResourceUrl(String path) {
|
public static URI createResourceUrl(String path) {
|
||||||
return REST_BASE_URL.resolve(path);
|
return REST_BASE_URL.resolve(path);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"bootstrap": "lerna bootstrap",
|
"bootstrap": "lerna bootstrap",
|
||||||
"link": "lerna exec -- yarn link",
|
"link": "lerna exec -- yarn link",
|
||||||
"unlink": "lerna exec -- yarn unlink"
|
"unlink": "lerna exec --no-bail -- yarn unlink"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"lerna": "^3.2.1"
|
"lerna": "^3.2.1"
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export function createUrl(url: string) {
|
|||||||
if (url.indexOf("/") !== 0) {
|
if (url.indexOf("/") !== 0) {
|
||||||
urlWithStartingSlash = "/" + urlWithStartingSlash;
|
urlWithStartingSlash = "/" + urlWithStartingSlash;
|
||||||
}
|
}
|
||||||
return `${contextPath}/api/rest/v2${urlWithStartingSlash}`;
|
return `${contextPath}/api/v2${urlWithStartingSlash}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ApiClient {
|
class ApiClient {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ describe("create url", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should add prefix for api", () => {
|
it("should add prefix for api", () => {
|
||||||
expect(createUrl("/users")).toBe("/api/rest/v2/users");
|
expect(createUrl("/users")).toBe("/api/v2/users");
|
||||||
expect(createUrl("users")).toBe("/api/rest/v2/users");
|
expect(createUrl("users")).toBe("/api/v2/users");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -48,6 +48,16 @@
|
|||||||
<script>bootstrap</script>
|
<script>bootstrap</script>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>unlink</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>run</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<script>unlink</script>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
<execution>
|
<execution>
|
||||||
<id>link</id>
|
<id>link</id>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
@@ -58,16 +68,6 @@
|
|||||||
<script>link</script>
|
<script>link</script>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
<execution>
|
|
||||||
<id>unlink</id>
|
|
||||||
<phase>clean</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>run</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<script>unlink</script>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import reducer, {
|
|||||||
getConfigUpdatePermission
|
getConfigUpdatePermission
|
||||||
} from "./config";
|
} from "./config";
|
||||||
|
|
||||||
const CONFIG_URL = "/api/rest/v2/config";
|
const CONFIG_URL = "/api/v2/config";
|
||||||
|
|
||||||
const error = new Error("You have an error!");
|
const error = new Error("You have an error!");
|
||||||
|
|
||||||
@@ -51,8 +51,8 @@ const config = {
|
|||||||
enabledXsrfProtection: true,
|
enabledXsrfProtection: true,
|
||||||
defaultNamespaceStrategy: "sonia.scm.repository.DefaultNamespaceStrategy",
|
defaultNamespaceStrategy: "sonia.scm.repository.DefaultNamespaceStrategy",
|
||||||
_links: {
|
_links: {
|
||||||
self: { href: "http://localhost:8081/api/rest/v2/config" },
|
self: { href: "http://localhost:8081/api/v2/config" },
|
||||||
update: { href: "http://localhost:8081/api/rest/v2/config" }
|
update: { href: "http://localhost:8081/api/v2/config" }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -80,8 +80,8 @@ const configWithNullValues = {
|
|||||||
enabledXsrfProtection: true,
|
enabledXsrfProtection: true,
|
||||||
defaultNamespaceStrategy: "sonia.scm.repository.DefaultNamespaceStrategy",
|
defaultNamespaceStrategy: "sonia.scm.repository.DefaultNamespaceStrategy",
|
||||||
_links: {
|
_links: {
|
||||||
self: { href: "http://localhost:8081/api/rest/v2/config" },
|
self: { href: "http://localhost:8081/api/v2/config" },
|
||||||
update: { href: "http://localhost:8081/api/rest/v2/config" }
|
update: { href: "http://localhost:8081/api/v2/config" }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ describe("config fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should successfully modify config", () => {
|
it("should successfully modify config", () => {
|
||||||
fetchMock.putOnce("http://localhost:8081/api/rest/v2/config", {
|
fetchMock.putOnce("http://localhost:8081/api/v2/config", {
|
||||||
status: 204
|
status: 204
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ describe("config fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should call the callback after modifying config", () => {
|
it("should call the callback after modifying config", () => {
|
||||||
fetchMock.putOnce("http://localhost:8081/api/rest/v2/config", {
|
fetchMock.putOnce("http://localhost:8081/api/v2/config", {
|
||||||
status: 204
|
status: 204
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ describe("config fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should fail modifying config on HTTP 500", () => {
|
it("should fail modifying config on HTTP 500", () => {
|
||||||
fetchMock.putOnce("http://localhost:8081/api/rest/v2/config", {
|
fetchMock.putOnce("http://localhost:8081/api/v2/config", {
|
||||||
status: 500
|
status: 500
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import reducer, {
|
|||||||
MODIFY_GROUP_SUCCESS,
|
MODIFY_GROUP_SUCCESS,
|
||||||
MODIFY_GROUP_FAILURE
|
MODIFY_GROUP_FAILURE
|
||||||
} from "./groups";
|
} from "./groups";
|
||||||
const GROUPS_URL = "/api/rest/v2/groups";
|
const GROUPS_URL = "/api/v2/groups";
|
||||||
|
|
||||||
const error = new Error("You have an error!");
|
const error = new Error("You have an error!");
|
||||||
|
|
||||||
@@ -57,13 +57,13 @@ const humanGroup = {
|
|||||||
members: ["userZaphod"],
|
members: ["userZaphod"],
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:8081/api/rest/v2/groups/humanGroup"
|
href: "http://localhost:8081/api/v2/groups/humanGroup"
|
||||||
},
|
},
|
||||||
delete: {
|
delete: {
|
||||||
href: "http://localhost:8081/api/rest/v2/groups/humanGroup"
|
href: "http://localhost:8081/api/v2/groups/humanGroup"
|
||||||
},
|
},
|
||||||
update: {
|
update: {
|
||||||
href:"http://localhost:8081/api/rest/v2/groups/humanGroup"
|
href:"http://localhost:8081/api/v2/groups/humanGroup"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_embedded: {
|
_embedded: {
|
||||||
@@ -72,7 +72,7 @@ const humanGroup = {
|
|||||||
name: "userZaphod",
|
name: "userZaphod",
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:8081/api/rest/v2/users/userZaphod"
|
href: "http://localhost:8081/api/v2/users/userZaphod"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -89,13 +89,13 @@ const emptyGroup = {
|
|||||||
members: [],
|
members: [],
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:8081/api/rest/v2/groups/emptyGroup"
|
href: "http://localhost:8081/api/v2/groups/emptyGroup"
|
||||||
},
|
},
|
||||||
delete: {
|
delete: {
|
||||||
href: "http://localhost:8081/api/rest/v2/groups/emptyGroup"
|
href: "http://localhost:8081/api/v2/groups/emptyGroup"
|
||||||
},
|
},
|
||||||
update: {
|
update: {
|
||||||
href:"http://localhost:8081/api/rest/v2/groups/emptyGroup"
|
href:"http://localhost:8081/api/v2/groups/emptyGroup"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_embedded: {
|
_embedded: {
|
||||||
@@ -108,16 +108,16 @@ const responseBody = {
|
|||||||
pageTotal: 1,
|
pageTotal: 1,
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:3000/api/rest/v2/groups/?page=0&pageSize=10"
|
href: "http://localhost:3000/api/v2/groups/?page=0&pageSize=10"
|
||||||
},
|
},
|
||||||
first: {
|
first: {
|
||||||
href: "http://localhost:3000/api/rest/v2/groups/?page=0&pageSize=10"
|
href: "http://localhost:3000/api/v2/groups/?page=0&pageSize=10"
|
||||||
},
|
},
|
||||||
last: {
|
last: {
|
||||||
href: "http://localhost:3000/api/rest/v2/groups/?page=0&pageSize=10"
|
href: "http://localhost:3000/api/v2/groups/?page=0&pageSize=10"
|
||||||
},
|
},
|
||||||
create: {
|
create: {
|
||||||
href: "http://localhost:3000/api/rest/v2/groups/"
|
href: "http://localhost:3000/api/v2/groups/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_embedded: {
|
_embedded: {
|
||||||
@@ -244,7 +244,7 @@ describe("groups fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should successfully modify group", () => {
|
it("should successfully modify group", () => {
|
||||||
fetchMock.putOnce("http://localhost:8081/api/rest/v2/groups/humanGroup", {
|
fetchMock.putOnce("http://localhost:8081/api/v2/groups/humanGroup", {
|
||||||
status: 204
|
status: 204
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@ describe("groups fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should call the callback after modifying group", () => {
|
it("should call the callback after modifying group", () => {
|
||||||
fetchMock.putOnce("http://localhost:8081/api/rest/v2/groups/humanGroup", {
|
fetchMock.putOnce("http://localhost:8081/api/v2/groups/humanGroup", {
|
||||||
status: 204
|
status: 204
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -278,7 +278,7 @@ describe("groups fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should fail modifying group on HTTP 500", () => {
|
it("should fail modifying group on HTTP 500", () => {
|
||||||
fetchMock.putOnce("http://localhost:8081/api/rest/v2/groups/humanGroup", {
|
fetchMock.putOnce("http://localhost:8081/api/v2/groups/humanGroup", {
|
||||||
status: 500
|
status: 500
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -293,7 +293,7 @@ describe("groups fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should delete successfully group humanGroup", () => {
|
it("should delete successfully group humanGroup", () => {
|
||||||
fetchMock.deleteOnce("http://localhost:8081/api/rest/v2/groups/humanGroup", {
|
fetchMock.deleteOnce("http://localhost:8081/api/v2/groups/humanGroup", {
|
||||||
status: 204
|
status: 204
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -308,7 +308,7 @@ describe("groups fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should call the callback, after successful delete", () => {
|
it("should call the callback, after successful delete", () => {
|
||||||
fetchMock.deleteOnce("http://localhost:8081/api/rest/v2/groups/humanGroup", {
|
fetchMock.deleteOnce("http://localhost:8081/api/v2/groups/humanGroup", {
|
||||||
status: 204
|
status: 204
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ describe("groups fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should fail to delete group humanGroup", () => {
|
it("should fail to delete group humanGroup", () => {
|
||||||
fetchMock.deleteOnce("http://localhost:8081/api/rest/v2/groups/humanGroup", {
|
fetchMock.deleteOnce("http://localhost:8081/api/v2/groups/humanGroup", {
|
||||||
status: 500
|
status: 500
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ describe("auth actions", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should dispatch login success and dispatch fetch me", () => {
|
it("should dispatch login success and dispatch fetch me", () => {
|
||||||
fetchMock.postOnce("/api/rest/v2/auth/access_token", {
|
fetchMock.postOnce("/api/v2/auth/access_token", {
|
||||||
body: {
|
body: {
|
||||||
cookie: true,
|
cookie: true,
|
||||||
grant_type: "password",
|
grant_type: "password",
|
||||||
@@ -88,7 +88,7 @@ describe("auth actions", () => {
|
|||||||
headers: { "content-type": "application/json" }
|
headers: { "content-type": "application/json" }
|
||||||
});
|
});
|
||||||
|
|
||||||
fetchMock.getOnce("/api/rest/v2/me", {
|
fetchMock.getOnce("/api/v2/me", {
|
||||||
body: me,
|
body: me,
|
||||||
headers: { "content-type": "application/json" }
|
headers: { "content-type": "application/json" }
|
||||||
});
|
});
|
||||||
@@ -106,7 +106,7 @@ describe("auth actions", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should dispatch login failure", () => {
|
it("should dispatch login failure", () => {
|
||||||
fetchMock.postOnce("/api/rest/v2/auth/access_token", {
|
fetchMock.postOnce("/api/v2/auth/access_token", {
|
||||||
status: 400
|
status: 400
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ describe("auth actions", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should dispatch fetch me success", () => {
|
it("should dispatch fetch me success", () => {
|
||||||
fetchMock.getOnce("/api/rest/v2/me", {
|
fetchMock.getOnce("/api/v2/me", {
|
||||||
body: me,
|
body: me,
|
||||||
headers: { "content-type": "application/json" }
|
headers: { "content-type": "application/json" }
|
||||||
});
|
});
|
||||||
@@ -141,7 +141,7 @@ describe("auth actions", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should dispatch fetch me failure", () => {
|
it("should dispatch fetch me failure", () => {
|
||||||
fetchMock.getOnce("/api/rest/v2/me", {
|
fetchMock.getOnce("/api/v2/me", {
|
||||||
status: 500
|
status: 500
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ describe("auth actions", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should dispatch fetch me unauthorized", () => {
|
it("should dispatch fetch me unauthorized", () => {
|
||||||
fetchMock.getOnce("/api/rest/v2/me", {
|
fetchMock.getOnce("/api/v2/me", {
|
||||||
status: 401
|
status: 401
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -173,11 +173,11 @@ describe("auth actions", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should dispatch logout success", () => {
|
it("should dispatch logout success", () => {
|
||||||
fetchMock.deleteOnce("/api/rest/v2/auth/access_token", {
|
fetchMock.deleteOnce("/api/v2/auth/access_token", {
|
||||||
status: 204
|
status: 204
|
||||||
});
|
});
|
||||||
|
|
||||||
fetchMock.getOnce("/api/rest/v2/me", {
|
fetchMock.getOnce("/api/v2/me", {
|
||||||
status: 401
|
status: 401
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ describe("auth actions", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should dispatch logout failure", () => {
|
it("should dispatch logout failure", () => {
|
||||||
fetchMock.deleteOnce("/api/rest/v2/auth/access_token", {
|
fetchMock.deleteOnce("/api/v2/auth/access_token", {
|
||||||
status: 500
|
status: 500
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -58,33 +58,33 @@ const hitchhikerPuzzle42: Repository = {
|
|||||||
type: "svn",
|
type: "svn",
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42"
|
href: "http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42"
|
||||||
},
|
},
|
||||||
delete: {
|
delete: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42"
|
href: "http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42"
|
||||||
},
|
},
|
||||||
update: {
|
update: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42"
|
href: "http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42"
|
||||||
},
|
},
|
||||||
permissions: {
|
permissions: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42/permissions/"
|
"http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42/permissions/"
|
||||||
},
|
},
|
||||||
tags: {
|
tags: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42/tags/"
|
"http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42/tags/"
|
||||||
},
|
},
|
||||||
branches: {
|
branches: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42/branches/"
|
"http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42/branches/"
|
||||||
},
|
},
|
||||||
changesets: {
|
changesets: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42/changesets/"
|
"http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42/changesets/"
|
||||||
},
|
},
|
||||||
sources: {
|
sources: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42/sources/"
|
"http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42/sources/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -100,35 +100,35 @@ const hitchhikerRestatend: Repository = {
|
|||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend"
|
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend"
|
||||||
},
|
},
|
||||||
delete: {
|
delete: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend"
|
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend"
|
||||||
},
|
},
|
||||||
update: {
|
update: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend"
|
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend"
|
||||||
},
|
},
|
||||||
permissions: {
|
permissions: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend/permissions/"
|
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend/permissions/"
|
||||||
},
|
},
|
||||||
tags: {
|
tags: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend/tags/"
|
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend/tags/"
|
||||||
},
|
},
|
||||||
branches: {
|
branches: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend/branches/"
|
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend/branches/"
|
||||||
},
|
},
|
||||||
changesets: {
|
changesets: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend/changesets/"
|
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend/changesets/"
|
||||||
},
|
},
|
||||||
sources: {
|
sources: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend/sources/"
|
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend/sources/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -142,32 +142,32 @@ const slartiFjords: Repository = {
|
|||||||
creationDate: "2018-07-31T08:59:05.653Z",
|
creationDate: "2018-07-31T08:59:05.653Z",
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/slarti/fjords"
|
href: "http://localhost:8081/api/v2/repositories/slarti/fjords"
|
||||||
},
|
},
|
||||||
delete: {
|
delete: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/slarti/fjords"
|
href: "http://localhost:8081/api/v2/repositories/slarti/fjords"
|
||||||
},
|
},
|
||||||
update: {
|
update: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/slarti/fjords"
|
href: "http://localhost:8081/api/v2/repositories/slarti/fjords"
|
||||||
},
|
},
|
||||||
permissions: {
|
permissions: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/slarti/fjords/permissions/"
|
"http://localhost:8081/api/v2/repositories/slarti/fjords/permissions/"
|
||||||
},
|
},
|
||||||
tags: {
|
tags: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/slarti/fjords/tags/"
|
href: "http://localhost:8081/api/v2/repositories/slarti/fjords/tags/"
|
||||||
},
|
},
|
||||||
branches: {
|
branches: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/slarti/fjords/branches/"
|
"http://localhost:8081/api/v2/repositories/slarti/fjords/branches/"
|
||||||
},
|
},
|
||||||
changesets: {
|
changesets: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/slarti/fjords/changesets/"
|
"http://localhost:8081/api/v2/repositories/slarti/fjords/changesets/"
|
||||||
},
|
},
|
||||||
sources: {
|
sources: {
|
||||||
href:
|
href:
|
||||||
"http://localhost:8081/api/rest/v2/repositories/slarti/fjords/sources/"
|
"http://localhost:8081/api/v2/repositories/slarti/fjords/sources/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -177,16 +177,16 @@ const repositoryCollection: RepositoryCollection = {
|
|||||||
pageTotal: 1,
|
pageTotal: 1,
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/?page=0&pageSize=10"
|
href: "http://localhost:8081/api/v2/repositories/?page=0&pageSize=10"
|
||||||
},
|
},
|
||||||
first: {
|
first: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/?page=0&pageSize=10"
|
href: "http://localhost:8081/api/v2/repositories/?page=0&pageSize=10"
|
||||||
},
|
},
|
||||||
last: {
|
last: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/?page=0&pageSize=10"
|
href: "http://localhost:8081/api/v2/repositories/?page=0&pageSize=10"
|
||||||
},
|
},
|
||||||
create: {
|
create: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/"
|
href: "http://localhost:8081/api/v2/repositories/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_embedded: {
|
_embedded: {
|
||||||
@@ -199,16 +199,16 @@ const repositoryCollectionWithNames: RepositoryCollection = {
|
|||||||
pageTotal: 1,
|
pageTotal: 1,
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/?page=0&pageSize=10"
|
href: "http://localhost:8081/api/v2/repositories/?page=0&pageSize=10"
|
||||||
},
|
},
|
||||||
first: {
|
first: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/?page=0&pageSize=10"
|
href: "http://localhost:8081/api/v2/repositories/?page=0&pageSize=10"
|
||||||
},
|
},
|
||||||
last: {
|
last: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/?page=0&pageSize=10"
|
href: "http://localhost:8081/api/v2/repositories/?page=0&pageSize=10"
|
||||||
},
|
},
|
||||||
create: {
|
create: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositories/"
|
href: "http://localhost:8081/api/v2/repositories/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_embedded: {
|
_embedded: {
|
||||||
@@ -221,7 +221,7 @@ const repositoryCollectionWithNames: RepositoryCollection = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
describe("repos fetch", () => {
|
describe("repos fetch", () => {
|
||||||
const REPOS_URL = "/api/rest/v2/repositories";
|
const REPOS_URL = "/api/v2/repositories";
|
||||||
const SORT = "sortBy=namespaceAndName";
|
const SORT = "sortBy=namespaceAndName";
|
||||||
const REPOS_URL_WITH_SORT = REPOS_URL + "?" + SORT;
|
const REPOS_URL_WITH_SORT = REPOS_URL + "?" + SORT;
|
||||||
const mockStore = configureMockStore([thunk]);
|
const mockStore = configureMockStore([thunk]);
|
||||||
@@ -293,7 +293,7 @@ describe("repos fetch", () => {
|
|||||||
|
|
||||||
it("should append sortby parameter and successfully fetch repos from link", () => {
|
it("should append sortby parameter and successfully fetch repos from link", () => {
|
||||||
fetchMock.getOnce(
|
fetchMock.getOnce(
|
||||||
"/api/rest/v2/repositories?one=1&sortBy=namespaceAndName",
|
"/api/v2/repositories?one=1&sortBy=namespaceAndName",
|
||||||
repositoryCollection
|
repositoryCollection
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -421,7 +421,7 @@ describe("repos fetch", () => {
|
|||||||
|
|
||||||
it("should successfully delete repo slarti/fjords", () => {
|
it("should successfully delete repo slarti/fjords", () => {
|
||||||
fetchMock.delete(
|
fetchMock.delete(
|
||||||
"http://localhost:8081/api/rest/v2/repositories/slarti/fjords",
|
"http://localhost:8081/api/v2/repositories/slarti/fjords",
|
||||||
{
|
{
|
||||||
status: 204
|
status: 204
|
||||||
}
|
}
|
||||||
@@ -448,7 +448,7 @@ describe("repos fetch", () => {
|
|||||||
|
|
||||||
it("should successfully delete repo slarti/fjords and call the callback", () => {
|
it("should successfully delete repo slarti/fjords and call the callback", () => {
|
||||||
fetchMock.delete(
|
fetchMock.delete(
|
||||||
"http://localhost:8081/api/rest/v2/repositories/slarti/fjords",
|
"http://localhost:8081/api/v2/repositories/slarti/fjords",
|
||||||
{
|
{
|
||||||
status: 204
|
status: 204
|
||||||
}
|
}
|
||||||
@@ -468,7 +468,7 @@ describe("repos fetch", () => {
|
|||||||
|
|
||||||
it("should disapatch failure on delete, if server returns status code 500", () => {
|
it("should disapatch failure on delete, if server returns status code 500", () => {
|
||||||
fetchMock.delete(
|
fetchMock.delete(
|
||||||
"http://localhost:8081/api/rest/v2/repositories/slarti/fjords",
|
"http://localhost:8081/api/v2/repositories/slarti/fjords",
|
||||||
{
|
{
|
||||||
status: 500
|
status: 500
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const git = {
|
|||||||
displayName: "Git",
|
displayName: "Git",
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositoryTypes/git"
|
href: "http://localhost:8081/api/v2/repositoryTypes/git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -32,7 +32,7 @@ const hg = {
|
|||||||
displayName: "Mercurial",
|
displayName: "Mercurial",
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositoryTypes/hg"
|
href: "http://localhost:8081/api/v2/repositoryTypes/hg"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -42,7 +42,7 @@ const svn = {
|
|||||||
displayName: "Subversion",
|
displayName: "Subversion",
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositoryTypes/svn"
|
href: "http://localhost:8081/api/v2/repositoryTypes/svn"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -53,7 +53,7 @@ const collection = {
|
|||||||
},
|
},
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:8081/api/rest/v2/repositoryTypes"
|
href: "http://localhost:8081/api/v2/repositoryTypes"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -97,7 +97,7 @@ describe("repository types caching", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("repository types fetch", () => {
|
describe("repository types fetch", () => {
|
||||||
const URL = "/api/rest/v2/repositoryTypes";
|
const URL = "/api/v2/repositoryTypes";
|
||||||
const mockStore = configureMockStore([thunk]);
|
const mockStore = configureMockStore([thunk]);
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ const hitchhiker_puzzle42RepoPermissions = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
describe("permission fetch", () => {
|
describe("permission fetch", () => {
|
||||||
const REPOS_URL = "/api/rest/v2/repositories";
|
const REPOS_URL = "/api/v2/repositories";
|
||||||
const mockStore = configureMockStore([thunk]);
|
const mockStore = configureMockStore([thunk]);
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
|||||||
@@ -61,13 +61,13 @@ const userZaphod = {
|
|||||||
properties: {},
|
properties: {},
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:8081/api/rest/v2/users/zaphod"
|
href: "http://localhost:8081/api/v2/users/zaphod"
|
||||||
},
|
},
|
||||||
delete: {
|
delete: {
|
||||||
href: "http://localhost:8081/api/rest/v2/users/zaphod"
|
href: "http://localhost:8081/api/v2/users/zaphod"
|
||||||
},
|
},
|
||||||
update: {
|
update: {
|
||||||
href: "http://localhost:8081/api/rest/v2/users/zaphod"
|
href: "http://localhost:8081/api/v2/users/zaphod"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -84,13 +84,13 @@ const userFord = {
|
|||||||
properties: {},
|
properties: {},
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:8081/api/rest/v2/users/ford"
|
href: "http://localhost:8081/api/v2/users/ford"
|
||||||
},
|
},
|
||||||
delete: {
|
delete: {
|
||||||
href: "http://localhost:8081/api/rest/v2/users/ford"
|
href: "http://localhost:8081/api/v2/users/ford"
|
||||||
},
|
},
|
||||||
update: {
|
update: {
|
||||||
href: "http://localhost:8081/api/rest/v2/users/ford"
|
href: "http://localhost:8081/api/v2/users/ford"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -100,16 +100,16 @@ const responseBody = {
|
|||||||
pageTotal: 1,
|
pageTotal: 1,
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: "http://localhost:3000/api/rest/v2/users/?page=0&pageSize=10"
|
href: "http://localhost:3000/api/v2/users/?page=0&pageSize=10"
|
||||||
},
|
},
|
||||||
first: {
|
first: {
|
||||||
href: "http://localhost:3000/api/rest/v2/users/?page=0&pageSize=10"
|
href: "http://localhost:3000/api/v2/users/?page=0&pageSize=10"
|
||||||
},
|
},
|
||||||
last: {
|
last: {
|
||||||
href: "http://localhost:3000/api/rest/v2/users/?page=0&pageSize=10"
|
href: "http://localhost:3000/api/v2/users/?page=0&pageSize=10"
|
||||||
},
|
},
|
||||||
create: {
|
create: {
|
||||||
href: "http://localhost:3000/api/rest/v2/users/"
|
href: "http://localhost:3000/api/v2/users/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_embedded: {
|
_embedded: {
|
||||||
@@ -122,7 +122,7 @@ const response = {
|
|||||||
responseBody
|
responseBody
|
||||||
};
|
};
|
||||||
|
|
||||||
const USERS_URL = "/api/rest/v2/users";
|
const USERS_URL = "/api/v2/users";
|
||||||
|
|
||||||
const error = new Error("KAPUTT");
|
const error = new Error("KAPUTT");
|
||||||
|
|
||||||
@@ -241,7 +241,7 @@ describe("users fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("successfully update user", () => {
|
it("successfully update user", () => {
|
||||||
fetchMock.putOnce("http://localhost:8081/api/rest/v2/users/zaphod", {
|
fetchMock.putOnce("http://localhost:8081/api/v2/users/zaphod", {
|
||||||
status: 204
|
status: 204
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ describe("users fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should call callback, after successful modified user", () => {
|
it("should call callback, after successful modified user", () => {
|
||||||
fetchMock.putOnce("http://localhost:8081/api/rest/v2/users/zaphod", {
|
fetchMock.putOnce("http://localhost:8081/api/v2/users/zaphod", {
|
||||||
status: 204
|
status: 204
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ describe("users fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should fail updating user on HTTP 500", () => {
|
it("should fail updating user on HTTP 500", () => {
|
||||||
fetchMock.putOnce("http://localhost:8081/api/rest/v2/users/zaphod", {
|
fetchMock.putOnce("http://localhost:8081/api/v2/users/zaphod", {
|
||||||
status: 500
|
status: 500
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -285,7 +285,7 @@ describe("users fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should delete successfully user zaphod", () => {
|
it("should delete successfully user zaphod", () => {
|
||||||
fetchMock.deleteOnce("http://localhost:8081/api/rest/v2/users/zaphod", {
|
fetchMock.deleteOnce("http://localhost:8081/api/v2/users/zaphod", {
|
||||||
status: 204
|
status: 204
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -300,7 +300,7 @@ describe("users fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should call the callback, after successful delete", () => {
|
it("should call the callback, after successful delete", () => {
|
||||||
fetchMock.deleteOnce("http://localhost:8081/api/rest/v2/users/zaphod", {
|
fetchMock.deleteOnce("http://localhost:8081/api/v2/users/zaphod", {
|
||||||
status: 204
|
status: 204
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -316,7 +316,7 @@ describe("users fetch()", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should fail to delete user zaphod", () => {
|
it("should fail to delete user zaphod", () => {
|
||||||
fetchMock.deleteOnce("http://localhost:8081/api/rest/v2/users/zaphod", {
|
fetchMock.deleteOnce("http://localhost:8081/api/v2/users/zaphod", {
|
||||||
status: 500
|
status: 500
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
<modules>
|
<modules>
|
||||||
|
|
||||||
<jaxrs datatype-detection="local">
|
<jaxrs datatype-detection="local">
|
||||||
<application path="/api/rest" />
|
<application path="/api" />
|
||||||
</jaxrs>
|
</jaxrs>
|
||||||
|
|
||||||
<docs disableResourceLinks="true" includeApplicationPath="true" />
|
<docs disableResourceLinks="true" includeApplicationPath="true" />
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ public class ScmServletModule extends ServletModule
|
|||||||
public static final String PATTERN_PLUGIN_SCRIPT = "/plugins/resources/js/*";
|
public static final String PATTERN_PLUGIN_SCRIPT = "/plugins/resources/js/*";
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
public static final String PATTERN_RESTAPI = "/api/rest/*";
|
public static final String PATTERN_RESTAPI = "/api/*";
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
public static final String PATTERN_SCRIPT = "*.js";
|
public static final String PATTERN_SCRIPT = "*.js";
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
<context-param>
|
<context-param>
|
||||||
<param-name>resteasy.servlet.mapping.prefix</param-name>
|
<param-name>resteasy.servlet.mapping.prefix</param-name>
|
||||||
<param-value>/api/rest</param-value>
|
<param-value>/api</param-value>
|
||||||
</context-param>
|
</context-param>
|
||||||
|
|
||||||
<servlet>
|
<servlet>
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
|
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>Resteasy</servlet-name>
|
<servlet-name>Resteasy</servlet-name>
|
||||||
<url-pattern>/api/rest/*</url-pattern>
|
<url-pattern>/api/*</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- capture sessions -->
|
<!-- capture sessions -->
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public class SecurityFilterTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testDoOnAuthenticationUrlV1() throws IOException, ServletException {
|
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
|
@Test
|
||||||
public void testDoOnAuthenticationUrlV2() throws IOException, ServletException {
|
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 {
|
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/";
|
public static final String BASE_URL = "http://localhost:8081/scm/";
|
||||||
|
|
||||||
/** scm-manager base url for the rest api */
|
/** 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 ---------------------------------------------------------
|
//~--- constructors ---------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class SecurityRequestsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIsAuthenticationRequestWithContextPath() {
|
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");
|
when(request.getContextPath()).thenReturn("/scm");
|
||||||
|
|
||||||
assertTrue(SecurityRequests.isAuthenticationRequest(request));
|
assertTrue(SecurityRequests.isAuthenticationRequest(request));
|
||||||
@@ -29,9 +29,9 @@ public class SecurityRequestsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIsAuthenticationRequest() throws Exception {
|
public void testIsAuthenticationRequest() throws Exception {
|
||||||
assertTrue(SecurityRequests.isAuthenticationRequest("/api/rest/auth/access_token"));
|
assertTrue(SecurityRequests.isAuthenticationRequest("/api/auth/access_token"));
|
||||||
assertTrue(SecurityRequests.isAuthenticationRequest("/api/rest/v2/auth/access_token"));
|
assertTrue(SecurityRequests.isAuthenticationRequest("/api/v2/auth/access_token"));
|
||||||
assertFalse(SecurityRequests.isAuthenticationRequest("/api/rest/repositories"));
|
assertFalse(SecurityRequests.isAuthenticationRequest("/api/repositories"));
|
||||||
assertFalse(SecurityRequests.isAuthenticationRequest("/api/rest/v2/repositories"));
|
assertFalse(SecurityRequests.isAuthenticationRequest("/api/v2/repositories"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user