mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 17:56:17 +01:00
fix wrong error messages in integration tests
This commit is contained in:
@@ -119,7 +119,7 @@ public abstract class AbstractPermissionITCaseBase<T>
|
|||||||
ClientResponse response = wr.post(ClientResponse.class, trillian);
|
ClientResponse response = wr.post(ClientResponse.class, trillian);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 201);
|
assertEquals(201, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
logoutClient(client);
|
logoutClient(client);
|
||||||
client.destroy();
|
client.destroy();
|
||||||
@@ -311,11 +311,11 @@ public abstract class AbstractPermissionITCaseBase<T>
|
|||||||
|
|
||||||
if (credentials.isAnonymous())
|
if (credentials.isAnonymous())
|
||||||
{
|
{
|
||||||
assertEquals(response.getStatus(), 401);
|
assertEquals(401, response.getStatus());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
assertEquals(response.getStatus(), 403);
|
assertEquals(403, response.getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
response.close();
|
response.close();
|
||||||
|
|||||||
@@ -286,11 +286,11 @@ public class AdminPermissionITCase
|
|||||||
|
|
||||||
if (credentials.isAnonymous())
|
if (credentials.isAnonymous())
|
||||||
{
|
{
|
||||||
assertEquals(response.getStatus(), 401);
|
assertEquals(401, response.getStatus());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
assertEquals(response.getStatus(), 403);
|
assertEquals(403, response.getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
// fix jersey-client bug
|
// fix jersey-client bug
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class AuthenticationITCase
|
|||||||
ClientResponse response = authenticate(client, "dent", "trillian");
|
ClientResponse response = authenticate(client, "dent", "trillian");
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 401);
|
assertEquals(401, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -218,11 +218,11 @@ public class ChangesetViewerITCase extends AbstractAdminITCaseBase
|
|||||||
|
|
||||||
if ("svn".equals(repositoryType))
|
if ("svn".equals(repositoryType))
|
||||||
{
|
{
|
||||||
assertEquals(cpr.getTotal(), (count + 1));
|
assertEquals((count + 1), cpr.getTotal());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
assertEquals(cpr.getTotal(), count);
|
assertEquals(count, cpr.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Changeset> changesets = cpr.getChangesets();
|
List<Changeset> changesets = cpr.getChangesets();
|
||||||
@@ -231,11 +231,11 @@ public class ChangesetViewerITCase extends AbstractAdminITCaseBase
|
|||||||
|
|
||||||
if ("svn".equals(repositoryType))
|
if ("svn".equals(repositoryType))
|
||||||
{
|
{
|
||||||
assertEquals(changesets.size(), (count + 1));
|
assertEquals((count + 1), changesets.size());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
assertEquals(changesets.size(), count);
|
assertEquals(count, changesets.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
Changeset c = changesets.get(0);
|
Changeset c = changesets.get(0);
|
||||||
@@ -252,8 +252,7 @@ public class ChangesetViewerITCase extends AbstractAdminITCaseBase
|
|||||||
|
|
||||||
assertNotNull(added);
|
assertNotNull(added);
|
||||||
assertFalse(added.isEmpty());
|
assertFalse(added.isEmpty());
|
||||||
assertEquals(added.size(), 1);
|
assertEquals(1, added.size());
|
||||||
|
|
||||||
//J-
|
//J-
|
||||||
assertThat(
|
assertThat(
|
||||||
added.get(0),
|
added.get(0),
|
||||||
@@ -342,7 +341,7 @@ public class ChangesetViewerITCase extends AbstractAdminITCaseBase
|
|||||||
ClientResponse response = resource.get(ClientResponse.class);
|
ClientResponse response = resource.get(ClientResponse.class);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertTrue(response.getStatus() == 200);
|
assertEquals(200, response.getStatus());
|
||||||
|
|
||||||
ChangesetPagingResult cpr = response.getEntity(ChangesetPagingResult.class);
|
ChangesetPagingResult cpr = response.getEntity(ChangesetPagingResult.class);
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ public class GroupITCase extends AbstractAdminITCaseBase
|
|||||||
ClientResponse response = wr.put(ClientResponse.class, group);
|
ClientResponse response = wr.put(ClientResponse.class, group);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 204);
|
assertEquals(204, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
|
|
||||||
Group other = getGroup("group-d");
|
Group other = getGroup("group-d");
|
||||||
@@ -202,7 +202,7 @@ public class GroupITCase extends AbstractAdminITCaseBase
|
|||||||
ClientResponse response = wr.post(ClientResponse.class, group);
|
ClientResponse response = wr.post(ClientResponse.class, group);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 201);
|
assertEquals(201, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
|
|
||||||
Group other = getGroup(group.getName());
|
Group other = getGroup(group.getName());
|
||||||
@@ -211,8 +211,8 @@ public class GroupITCase extends AbstractAdminITCaseBase
|
|||||||
assertNotNull(other.getType());
|
assertNotNull(other.getType());
|
||||||
assertEquals(group.getName(), other.getName());
|
assertEquals(group.getName(), other.getName());
|
||||||
assertEquals(group.getDescription(), other.getDescription());
|
assertEquals(group.getDescription(), other.getDescription());
|
||||||
assertArrayEquals(group.getMembers().toArray(new String[0]),
|
assertArrayEquals(other.getMembers().toArray(new String[0]),
|
||||||
other.getMembers().toArray(new String[0]));
|
group.getMembers().toArray(new String[0]));
|
||||||
assertNotNull(other.getCreationDate());
|
assertNotNull(other.getCreationDate());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,12 +228,12 @@ public class GroupITCase extends AbstractAdminITCaseBase
|
|||||||
ClientResponse response = wr.delete(ClientResponse.class);
|
ClientResponse response = wr.delete(ClientResponse.class);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 204);
|
assertEquals(204, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
wr = createResource(client, "groups/".concat(name));
|
wr = createResource(client, "groups/".concat(name));
|
||||||
response = wr.get(ClientResponse.class);
|
response = wr.get(ClientResponse.class);
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 404);
|
assertEquals(404, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,7 +258,7 @@ public class GroupITCase extends AbstractAdminITCaseBase
|
|||||||
|
|
||||||
response.close();
|
response.close();
|
||||||
assertNotNull(group);
|
assertNotNull(group);
|
||||||
assertEquals(group.getName(), groupname);
|
assertEquals(groupname, group.getName());
|
||||||
|
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class GroupPermissionITCase extends AbstractPermissionITCaseBase<Group>
|
|||||||
ClientResponse response = wr.post(ClientResponse.class, testGroup);
|
ClientResponse response = wr.post(ClientResponse.class, testGroup);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 201);
|
assertEquals(201, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
logoutClient(client);
|
logoutClient(client);
|
||||||
client.destroy();
|
client.destroy();
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public class IntegrationTestUtil
|
|||||||
User user = state.getUser();
|
User user = state.getUser();
|
||||||
|
|
||||||
assertNotNull(user);
|
assertNotNull(user);
|
||||||
assertEquals(user.getName(), "scmadmin");
|
assertEquals("scmadmin", user.getName());
|
||||||
assertTrue(user.isAdmin());
|
assertTrue(user.isAdmin());
|
||||||
|
|
||||||
Collection<Type> types = state.getRepositoryTypes();
|
Collection<Type> types = state.getRepositoryTypes();
|
||||||
@@ -254,7 +254,7 @@ public class IntegrationTestUtil
|
|||||||
ClientResponse response = wr.get(ClientResponse.class);
|
ClientResponse response = wr.get(ClientResponse.class);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 200);
|
assertEquals(200, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
client.destroy();
|
client.destroy();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ public class RepositoryITCase extends AbstractAdminITCaseBase
|
|||||||
ClientResponse response = wr.put(ClientResponse.class, repository);
|
ClientResponse response = wr.put(ClientResponse.class, repository);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 204);
|
assertEquals(204, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
|
|
||||||
Repository other = getRepositoryById(client, repository.getId());
|
Repository other = getRepositoryById(client, repository.getId());
|
||||||
@@ -222,7 +222,7 @@ public class RepositoryITCase extends AbstractAdminITCaseBase
|
|||||||
ClientResponse response = wr.get(ClientResponse.class);
|
ClientResponse response = wr.get(ClientResponse.class);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 200);
|
assertEquals(200, response.getStatus());
|
||||||
|
|
||||||
Collection<Repository> repositories =
|
Collection<Repository> repositories =
|
||||||
response.getEntity(new GenericType<Collection<Repository>>() {}
|
response.getEntity(new GenericType<Collection<Repository>>() {}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class RepositoryITUtil
|
|||||||
ClientResponse response = wr.post(ClientResponse.class, repository);
|
ClientResponse response = wr.post(ClientResponse.class, repository);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 201);
|
assertEquals(201, response.getStatus());
|
||||||
|
|
||||||
String url = response.getHeaders().get("Location").get(0);
|
String url = response.getHeaders().get("Location").get(0);
|
||||||
|
|
||||||
@@ -119,12 +119,12 @@ public class RepositoryITUtil
|
|||||||
ClientResponse response = wr.delete(ClientResponse.class);
|
ClientResponse response = wr.delete(ClientResponse.class);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 204);
|
assertEquals(204, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
wr = createResource(client, "repositories/".concat(id));
|
wr = createResource(client, "repositories/".concat(id));
|
||||||
response = wr.get(ClientResponse.class);
|
response = wr.get(ClientResponse.class);
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 404);
|
assertEquals(204, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class RepositorySimplePermissionITCase
|
|||||||
ClientResponse response = wr.post(ClientResponse.class, repository);
|
ClientResponse response = wr.post(ClientResponse.class, repository);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 201);
|
assertEquals(201, response.getStatus());
|
||||||
|
|
||||||
String repositoryUrl = response.getHeaders().getFirst("Location");
|
String repositoryUrl = response.getHeaders().getFirst("Location");
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ public class RepositorySimplePermissionITCase
|
|||||||
wr = client.resource(repositoryUrl);
|
wr = client.resource(repositoryUrl);
|
||||||
response = wr.get(ClientResponse.class);
|
response = wr.get(ClientResponse.class);
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 200);
|
assertEquals(200, response.getStatus());
|
||||||
repository = response.getEntity(Repository.class);
|
repository = response.getEntity(Repository.class);
|
||||||
assertNotNull(repository);
|
assertNotNull(repository);
|
||||||
REPOSITORY_UUID = repository.getId();
|
REPOSITORY_UUID = repository.getId();
|
||||||
@@ -148,7 +148,7 @@ public class RepositorySimplePermissionITCase
|
|||||||
if (!credentials.isAnonymous())
|
if (!credentials.isAnonymous())
|
||||||
{
|
{
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 200);
|
assertEquals(200, response.getStatus());
|
||||||
|
|
||||||
Collection<Repository> repositories =
|
Collection<Repository> repositories =
|
||||||
response.getEntity(new GenericType<Collection<Repository>>() {}
|
response.getEntity(new GenericType<Collection<Repository>>() {}
|
||||||
@@ -172,7 +172,7 @@ public class RepositorySimplePermissionITCase
|
|||||||
if (!credentials.isAnonymous())
|
if (!credentials.isAnonymous())
|
||||||
{
|
{
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 403);
|
assertEquals(403, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ public class UserITCase extends AbstractAdminITCaseBase
|
|||||||
wr.type(MediaType.APPLICATION_XML).put(ClientResponse.class, marvin);
|
wr.type(MediaType.APPLICATION_XML).put(ClientResponse.class, marvin);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 204);
|
assertEquals(204, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
|
|
||||||
User other = getUser(marvin.getName());
|
User other = getUser(marvin.getName());
|
||||||
@@ -158,7 +158,7 @@ public class UserITCase extends AbstractAdminITCaseBase
|
|||||||
ClientResponse response = wr.get(ClientResponse.class);
|
ClientResponse response = wr.get(ClientResponse.class);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 200);
|
assertEquals(200, response.getStatus());
|
||||||
|
|
||||||
Collection<User> users =
|
Collection<User> users =
|
||||||
response.getEntity(new GenericType<Collection<User>>() {}
|
response.getEntity(new GenericType<Collection<User>>() {}
|
||||||
@@ -201,7 +201,7 @@ public class UserITCase extends AbstractAdminITCaseBase
|
|||||||
User user = state.getUser();
|
User user = state.getUser();
|
||||||
|
|
||||||
assertNotNull(user);
|
assertNotNull(user);
|
||||||
assertEquals(user.getName(), "scmadmin");
|
assertEquals("scmadmin", user.getName());
|
||||||
assertTrue(user.isAdmin());
|
assertTrue(user.isAdmin());
|
||||||
|
|
||||||
Collection<Type> types = state.getRepositoryTypes();
|
Collection<Type> types = state.getRepositoryTypes();
|
||||||
@@ -223,7 +223,7 @@ public class UserITCase extends AbstractAdminITCaseBase
|
|||||||
wr.type(MediaType.APPLICATION_XML).post(ClientResponse.class, user);
|
wr.type(MediaType.APPLICATION_XML).post(ClientResponse.class, user);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 201);
|
assertEquals(201, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
|
|
||||||
User other = getUser(user.getName());
|
User other = getUser(user.getName());
|
||||||
@@ -247,12 +247,12 @@ public class UserITCase extends AbstractAdminITCaseBase
|
|||||||
ClientResponse response = wr.delete(ClientResponse.class);
|
ClientResponse response = wr.delete(ClientResponse.class);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 204);
|
assertEquals(204, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
wr = createResource(client, "users/".concat(user.getName()));
|
wr = createResource(client, "users/".concat(user.getName()));
|
||||||
response = wr.get(ClientResponse.class);
|
response = wr.get(ClientResponse.class);
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 404);
|
assertEquals(404, response.getStatus());
|
||||||
response.close();
|
response.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,7 +285,7 @@ public class UserITCase extends AbstractAdminITCaseBase
|
|||||||
ClientResponse response = wr.get(ClientResponse.class);
|
ClientResponse response = wr.get(ClientResponse.class);
|
||||||
|
|
||||||
assertNotNull(response);
|
assertNotNull(response);
|
||||||
assertEquals(response.getStatus(), 200);
|
assertEquals(200, response.getStatus());
|
||||||
|
|
||||||
User user = response.getEntity(User.class);
|
User user = response.getEntity(User.class);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user