mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 10:16:16 +01:00
Merged 2.0.0-m3
This commit is contained in:
@@ -23,7 +23,7 @@ import reducer, {
|
||||
getConfigUpdatePermission
|
||||
} from "./config";
|
||||
|
||||
const CONFIG_URL = "/api/rest/v2/config";
|
||||
const CONFIG_URL = "/api/v2/config";
|
||||
|
||||
const error = new Error("You have an error!");
|
||||
|
||||
@@ -51,8 +51,8 @@ const config = {
|
||||
enabledXsrfProtection: true,
|
||||
defaultNamespaceStrategy: "sonia.scm.repository.DefaultNamespaceStrategy",
|
||||
_links: {
|
||||
self: { href: "http://localhost:8081/api/rest/v2/config" },
|
||||
update: { href: "http://localhost:8081/api/rest/v2/config" }
|
||||
self: { href: "http://localhost:8081/api/v2/config" },
|
||||
update: { href: "http://localhost:8081/api/v2/config" }
|
||||
}
|
||||
};
|
||||
|
||||
@@ -80,8 +80,8 @@ const configWithNullValues = {
|
||||
enabledXsrfProtection: true,
|
||||
defaultNamespaceStrategy: "sonia.scm.repository.DefaultNamespaceStrategy",
|
||||
_links: {
|
||||
self: { href: "http://localhost:8081/api/rest/v2/config" },
|
||||
update: { href: "http://localhost:8081/api/rest/v2/config" }
|
||||
self: { href: "http://localhost:8081/api/v2/config" },
|
||||
update: { href: "http://localhost:8081/api/v2/config" }
|
||||
}
|
||||
};
|
||||
|
||||
@@ -135,7 +135,7 @@ describe("config fetch()", () => {
|
||||
});
|
||||
|
||||
it("should successfully modify config", () => {
|
||||
fetchMock.putOnce("http://localhost:8081/api/rest/v2/config", {
|
||||
fetchMock.putOnce("http://localhost:8081/api/v2/config", {
|
||||
status: 204
|
||||
});
|
||||
|
||||
@@ -150,7 +150,7 @@ describe("config fetch()", () => {
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
@@ -169,7 +169,7 @@ describe("config fetch()", () => {
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ import reducer, {
|
||||
MODIFY_GROUP_SUCCESS,
|
||||
MODIFY_GROUP_FAILURE
|
||||
} from "./groups";
|
||||
const GROUPS_URL = "/api/rest/v2/groups";
|
||||
const GROUPS_URL = "/api/v2/groups";
|
||||
|
||||
const error = new Error("You have an error!");
|
||||
|
||||
@@ -57,13 +57,13 @@ const humanGroup = {
|
||||
members: ["userZaphod"],
|
||||
_links: {
|
||||
self: {
|
||||
href: "http://localhost:8081/api/rest/v2/groups/humanGroup"
|
||||
href: "http://localhost:8081/api/v2/groups/humanGroup"
|
||||
},
|
||||
delete: {
|
||||
href: "http://localhost:8081/api/rest/v2/groups/humanGroup"
|
||||
href: "http://localhost:8081/api/v2/groups/humanGroup"
|
||||
},
|
||||
update: {
|
||||
href:"http://localhost:8081/api/rest/v2/groups/humanGroup"
|
||||
href:"http://localhost:8081/api/v2/groups/humanGroup"
|
||||
}
|
||||
},
|
||||
_embedded: {
|
||||
@@ -72,7 +72,7 @@ const humanGroup = {
|
||||
name: "userZaphod",
|
||||
_links: {
|
||||
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: [],
|
||||
_links: {
|
||||
self: {
|
||||
href: "http://localhost:8081/api/rest/v2/groups/emptyGroup"
|
||||
href: "http://localhost:8081/api/v2/groups/emptyGroup"
|
||||
},
|
||||
delete: {
|
||||
href: "http://localhost:8081/api/rest/v2/groups/emptyGroup"
|
||||
href: "http://localhost:8081/api/v2/groups/emptyGroup"
|
||||
},
|
||||
update: {
|
||||
href:"http://localhost:8081/api/rest/v2/groups/emptyGroup"
|
||||
href:"http://localhost:8081/api/v2/groups/emptyGroup"
|
||||
}
|
||||
},
|
||||
_embedded: {
|
||||
@@ -108,16 +108,16 @@ const responseBody = {
|
||||
pageTotal: 1,
|
||||
_links: {
|
||||
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: {
|
||||
href: "http://localhost:3000/api/rest/v2/groups/?page=0&pageSize=10"
|
||||
href: "http://localhost:3000/api/v2/groups/?page=0&pageSize=10"
|
||||
},
|
||||
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: {
|
||||
href: "http://localhost:3000/api/rest/v2/groups/"
|
||||
href: "http://localhost:3000/api/v2/groups/"
|
||||
}
|
||||
},
|
||||
_embedded: {
|
||||
@@ -244,7 +244,7 @@ describe("groups fetch()", () => {
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
@@ -259,7 +259,7 @@ describe("groups fetch()", () => {
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
@@ -278,7 +278,7 @@ describe("groups fetch()", () => {
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
@@ -293,7 +293,7 @@ describe("groups fetch()", () => {
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
@@ -308,7 +308,7 @@ describe("groups fetch()", () => {
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
@@ -324,7 +324,7 @@ describe("groups fetch()", () => {
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ describe("auth actions", () => {
|
||||
});
|
||||
|
||||
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: {
|
||||
cookie: true,
|
||||
grant_type: "password",
|
||||
@@ -88,7 +88,7 @@ describe("auth actions", () => {
|
||||
headers: { "content-type": "application/json" }
|
||||
});
|
||||
|
||||
fetchMock.getOnce("/api/rest/v2/me", {
|
||||
fetchMock.getOnce("/api/v2/me", {
|
||||
body: me,
|
||||
headers: { "content-type": "application/json" }
|
||||
});
|
||||
@@ -106,7 +106,7 @@ describe("auth actions", () => {
|
||||
});
|
||||
|
||||
it("should dispatch login failure", () => {
|
||||
fetchMock.postOnce("/api/rest/v2/auth/access_token", {
|
||||
fetchMock.postOnce("/api/v2/auth/access_token", {
|
||||
status: 400
|
||||
});
|
||||
|
||||
@@ -120,7 +120,7 @@ describe("auth actions", () => {
|
||||
});
|
||||
|
||||
it("should dispatch fetch me success", () => {
|
||||
fetchMock.getOnce("/api/rest/v2/me", {
|
||||
fetchMock.getOnce("/api/v2/me", {
|
||||
body: me,
|
||||
headers: { "content-type": "application/json" }
|
||||
});
|
||||
@@ -141,7 +141,7 @@ describe("auth actions", () => {
|
||||
});
|
||||
|
||||
it("should dispatch fetch me failure", () => {
|
||||
fetchMock.getOnce("/api/rest/v2/me", {
|
||||
fetchMock.getOnce("/api/v2/me", {
|
||||
status: 500
|
||||
});
|
||||
|
||||
@@ -155,7 +155,7 @@ describe("auth actions", () => {
|
||||
});
|
||||
|
||||
it("should dispatch fetch me unauthorized", () => {
|
||||
fetchMock.getOnce("/api/rest/v2/me", {
|
||||
fetchMock.getOnce("/api/v2/me", {
|
||||
status: 401
|
||||
});
|
||||
|
||||
@@ -173,11 +173,11 @@ describe("auth actions", () => {
|
||||
});
|
||||
|
||||
it("should dispatch logout success", () => {
|
||||
fetchMock.deleteOnce("/api/rest/v2/auth/access_token", {
|
||||
fetchMock.deleteOnce("/api/v2/auth/access_token", {
|
||||
status: 204
|
||||
});
|
||||
|
||||
fetchMock.getOnce("/api/rest/v2/me", {
|
||||
fetchMock.getOnce("/api/v2/me", {
|
||||
status: 401
|
||||
});
|
||||
|
||||
@@ -194,7 +194,7 @@ describe("auth actions", () => {
|
||||
});
|
||||
|
||||
it("should dispatch logout failure", () => {
|
||||
fetchMock.deleteOnce("/api/rest/v2/auth/access_token", {
|
||||
fetchMock.deleteOnce("/api/v2/auth/access_token", {
|
||||
status: 500
|
||||
});
|
||||
|
||||
|
||||
@@ -58,33 +58,33 @@ const hitchhikerPuzzle42: Repository = {
|
||||
type: "svn",
|
||||
_links: {
|
||||
self: {
|
||||
href: "http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42"
|
||||
href: "http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42"
|
||||
},
|
||||
delete: {
|
||||
href: "http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42"
|
||||
href: "http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42"
|
||||
},
|
||||
update: {
|
||||
href: "http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42"
|
||||
href: "http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42"
|
||||
},
|
||||
permissions: {
|
||||
href:
|
||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42/permissions/"
|
||||
"http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42/permissions/"
|
||||
},
|
||||
tags: {
|
||||
href:
|
||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42/tags/"
|
||||
"http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42/tags/"
|
||||
},
|
||||
branches: {
|
||||
href:
|
||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42/branches/"
|
||||
"http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42/branches/"
|
||||
},
|
||||
changesets: {
|
||||
href:
|
||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/puzzle42/changesets/"
|
||||
"http://localhost:8081/api/v2/repositories/hitchhiker/puzzle42/changesets/"
|
||||
},
|
||||
sources: {
|
||||
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: {
|
||||
self: {
|
||||
href:
|
||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend"
|
||||
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend"
|
||||
},
|
||||
delete: {
|
||||
href:
|
||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend"
|
||||
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend"
|
||||
},
|
||||
update: {
|
||||
href:
|
||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend"
|
||||
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend"
|
||||
},
|
||||
permissions: {
|
||||
href:
|
||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend/permissions/"
|
||||
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend/permissions/"
|
||||
},
|
||||
tags: {
|
||||
href:
|
||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend/tags/"
|
||||
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend/tags/"
|
||||
},
|
||||
branches: {
|
||||
href:
|
||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend/branches/"
|
||||
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend/branches/"
|
||||
},
|
||||
changesets: {
|
||||
href:
|
||||
"http://localhost:8081/api/rest/v2/repositories/hitchhiker/restatend/changesets/"
|
||||
"http://localhost:8081/api/v2/repositories/hitchhiker/restatend/changesets/"
|
||||
},
|
||||
sources: {
|
||||
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",
|
||||
_links: {
|
||||
self: {
|
||||
href: "http://localhost:8081/api/rest/v2/repositories/slarti/fjords"
|
||||
href: "http://localhost:8081/api/v2/repositories/slarti/fjords"
|
||||
},
|
||||
delete: {
|
||||
href: "http://localhost:8081/api/rest/v2/repositories/slarti/fjords"
|
||||
href: "http://localhost:8081/api/v2/repositories/slarti/fjords"
|
||||
},
|
||||
update: {
|
||||
href: "http://localhost:8081/api/rest/v2/repositories/slarti/fjords"
|
||||
href: "http://localhost:8081/api/v2/repositories/slarti/fjords"
|
||||
},
|
||||
permissions: {
|
||||
href:
|
||||
"http://localhost:8081/api/rest/v2/repositories/slarti/fjords/permissions/"
|
||||
"http://localhost:8081/api/v2/repositories/slarti/fjords/permissions/"
|
||||
},
|
||||
tags: {
|
||||
href: "http://localhost:8081/api/rest/v2/repositories/slarti/fjords/tags/"
|
||||
href: "http://localhost:8081/api/v2/repositories/slarti/fjords/tags/"
|
||||
},
|
||||
branches: {
|
||||
href:
|
||||
"http://localhost:8081/api/rest/v2/repositories/slarti/fjords/branches/"
|
||||
"http://localhost:8081/api/v2/repositories/slarti/fjords/branches/"
|
||||
},
|
||||
changesets: {
|
||||
href:
|
||||
"http://localhost:8081/api/rest/v2/repositories/slarti/fjords/changesets/"
|
||||
"http://localhost:8081/api/v2/repositories/slarti/fjords/changesets/"
|
||||
},
|
||||
sources: {
|
||||
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,
|
||||
_links: {
|
||||
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: {
|
||||
href: "http://localhost:8081/api/rest/v2/repositories/?page=0&pageSize=10"
|
||||
href: "http://localhost:8081/api/v2/repositories/?page=0&pageSize=10"
|
||||
},
|
||||
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: {
|
||||
href: "http://localhost:8081/api/rest/v2/repositories/"
|
||||
href: "http://localhost:8081/api/v2/repositories/"
|
||||
}
|
||||
},
|
||||
_embedded: {
|
||||
@@ -199,16 +199,16 @@ const repositoryCollectionWithNames: RepositoryCollection = {
|
||||
pageTotal: 1,
|
||||
_links: {
|
||||
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: {
|
||||
href: "http://localhost:8081/api/rest/v2/repositories/?page=0&pageSize=10"
|
||||
href: "http://localhost:8081/api/v2/repositories/?page=0&pageSize=10"
|
||||
},
|
||||
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: {
|
||||
href: "http://localhost:8081/api/rest/v2/repositories/"
|
||||
href: "http://localhost:8081/api/v2/repositories/"
|
||||
}
|
||||
},
|
||||
_embedded: {
|
||||
@@ -221,7 +221,7 @@ const repositoryCollectionWithNames: RepositoryCollection = {
|
||||
};
|
||||
|
||||
describe("repos fetch", () => {
|
||||
const REPOS_URL = "/api/rest/v2/repositories";
|
||||
const REPOS_URL = "/api/v2/repositories";
|
||||
const SORT = "sortBy=namespaceAndName";
|
||||
const REPOS_URL_WITH_SORT = REPOS_URL + "?" + SORT;
|
||||
const mockStore = configureMockStore([thunk]);
|
||||
@@ -293,7 +293,7 @@ describe("repos fetch", () => {
|
||||
|
||||
it("should append sortby parameter and successfully fetch repos from link", () => {
|
||||
fetchMock.getOnce(
|
||||
"/api/rest/v2/repositories?one=1&sortBy=namespaceAndName",
|
||||
"/api/v2/repositories?one=1&sortBy=namespaceAndName",
|
||||
repositoryCollection
|
||||
);
|
||||
|
||||
@@ -421,7 +421,7 @@ describe("repos fetch", () => {
|
||||
|
||||
it("should successfully delete repo slarti/fjords", () => {
|
||||
fetchMock.delete(
|
||||
"http://localhost:8081/api/rest/v2/repositories/slarti/fjords",
|
||||
"http://localhost:8081/api/v2/repositories/slarti/fjords",
|
||||
{
|
||||
status: 204
|
||||
}
|
||||
@@ -448,7 +448,7 @@ describe("repos fetch", () => {
|
||||
|
||||
it("should successfully delete repo slarti/fjords and call the callback", () => {
|
||||
fetchMock.delete(
|
||||
"http://localhost:8081/api/rest/v2/repositories/slarti/fjords",
|
||||
"http://localhost:8081/api/v2/repositories/slarti/fjords",
|
||||
{
|
||||
status: 204
|
||||
}
|
||||
@@ -468,7 +468,7 @@ describe("repos fetch", () => {
|
||||
|
||||
it("should disapatch failure on delete, if server returns status code 500", () => {
|
||||
fetchMock.delete(
|
||||
"http://localhost:8081/api/rest/v2/repositories/slarti/fjords",
|
||||
"http://localhost:8081/api/v2/repositories/slarti/fjords",
|
||||
{
|
||||
status: 500
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ const git = {
|
||||
displayName: "Git",
|
||||
_links: {
|
||||
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",
|
||||
_links: {
|
||||
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",
|
||||
_links: {
|
||||
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: {
|
||||
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", () => {
|
||||
const URL = "/api/rest/v2/repositoryTypes";
|
||||
const URL = "/api/v2/repositoryTypes";
|
||||
const mockStore = configureMockStore([thunk]);
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
@@ -100,7 +100,7 @@ const hitchhiker_puzzle42RepoPermissions = {
|
||||
};
|
||||
|
||||
describe("permission fetch", () => {
|
||||
const REPOS_URL = "/api/rest/v2/repositories";
|
||||
const REPOS_URL = "/api/v2/repositories";
|
||||
const mockStore = configureMockStore([thunk]);
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
@@ -61,13 +61,13 @@ const userZaphod = {
|
||||
properties: {},
|
||||
_links: {
|
||||
self: {
|
||||
href: "http://localhost:8081/api/rest/v2/users/zaphod"
|
||||
href: "http://localhost:8081/api/v2/users/zaphod"
|
||||
},
|
||||
delete: {
|
||||
href: "http://localhost:8081/api/rest/v2/users/zaphod"
|
||||
href: "http://localhost:8081/api/v2/users/zaphod"
|
||||
},
|
||||
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: {},
|
||||
_links: {
|
||||
self: {
|
||||
href: "http://localhost:8081/api/rest/v2/users/ford"
|
||||
href: "http://localhost:8081/api/v2/users/ford"
|
||||
},
|
||||
delete: {
|
||||
href: "http://localhost:8081/api/rest/v2/users/ford"
|
||||
href: "http://localhost:8081/api/v2/users/ford"
|
||||
},
|
||||
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,
|
||||
_links: {
|
||||
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: {
|
||||
href: "http://localhost:3000/api/rest/v2/users/?page=0&pageSize=10"
|
||||
href: "http://localhost:3000/api/v2/users/?page=0&pageSize=10"
|
||||
},
|
||||
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: {
|
||||
href: "http://localhost:3000/api/rest/v2/users/"
|
||||
href: "http://localhost:3000/api/v2/users/"
|
||||
}
|
||||
},
|
||||
_embedded: {
|
||||
@@ -122,7 +122,7 @@ const response = {
|
||||
responseBody
|
||||
};
|
||||
|
||||
const USERS_URL = "/api/rest/v2/users";
|
||||
const USERS_URL = "/api/v2/users";
|
||||
|
||||
const error = new Error("KAPUTT");
|
||||
|
||||
@@ -241,7 +241,7 @@ describe("users fetch()", () => {
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
@@ -255,7 +255,7 @@ describe("users fetch()", () => {
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
@@ -271,7 +271,7 @@ describe("users fetch()", () => {
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
@@ -285,7 +285,7 @@ describe("users fetch()", () => {
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
@@ -300,7 +300,7 @@ describe("users fetch()", () => {
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
@@ -316,7 +316,7 @@ describe("users fetch()", () => {
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user