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