mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
close ClientResponse
This commit is contained in:
@@ -76,6 +76,7 @@ public class AuthenticationITCase extends AbstractITCaseBase
|
||||
|
||||
assertNotNull(response);
|
||||
assertTrue(response.getStatus() == 401);
|
||||
response.close();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -120,6 +120,7 @@ public class GroupITCase extends AbstractAdminITCaseBase
|
||||
|
||||
assertNotNull(response);
|
||||
assertTrue(response.getStatus() == 204);
|
||||
response.close();
|
||||
|
||||
Group other = getGroup("group-d");
|
||||
|
||||
@@ -149,6 +150,7 @@ public class GroupITCase extends AbstractAdminITCaseBase
|
||||
response.getEntity(new GenericType<Collection<Group>>() {}
|
||||
);
|
||||
|
||||
response.close();
|
||||
assertNotNull(groups);
|
||||
assertFalse(groups.isEmpty());
|
||||
|
||||
@@ -182,6 +184,7 @@ public class GroupITCase extends AbstractAdminITCaseBase
|
||||
|
||||
assertNotNull(response);
|
||||
assertTrue(response.getStatus() == 201);
|
||||
response.close();
|
||||
|
||||
Group other = getGroup(group.getName());
|
||||
|
||||
@@ -207,13 +210,12 @@ public class GroupITCase extends AbstractAdminITCaseBase
|
||||
|
||||
assertNotNull(response);
|
||||
assertTrue(response.getStatus() == 204);
|
||||
|
||||
|
||||
response.close();
|
||||
wr = createResource(client, "groups/".concat(name));
|
||||
response = wr.get(ClientResponse.class);
|
||||
|
||||
assertNotNull(response);
|
||||
assertTrue(response.getStatus() == 404);
|
||||
response.close();
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
@@ -235,6 +237,7 @@ public class GroupITCase extends AbstractAdminITCaseBase
|
||||
|
||||
Group group = response.getEntity(Group.class);
|
||||
|
||||
response.close();
|
||||
assertNotNull(group);
|
||||
assertEquals(group.getName(), groupname);
|
||||
|
||||
|
||||
@@ -164,6 +164,7 @@ public class RepositoryITCase extends AbstractAdminITCaseBase
|
||||
|
||||
assertNotNull(response);
|
||||
assertTrue(response.getStatus() == 204);
|
||||
response.close();
|
||||
|
||||
Repository other = getRepositoryById(repository.getId());
|
||||
|
||||
@@ -195,6 +196,7 @@ public class RepositoryITCase extends AbstractAdminITCaseBase
|
||||
response.getEntity(new GenericType<Collection<Repository>>() {}
|
||||
);
|
||||
|
||||
response.close();
|
||||
assertNotNull(repositories);
|
||||
assertFalse(repositories.isEmpty());
|
||||
|
||||
@@ -248,6 +250,9 @@ public class RepositoryITCase extends AbstractAdminITCaseBase
|
||||
assertTrue(response.getStatus() == 201);
|
||||
|
||||
String url = response.getHeaders().get("Location").get(0);
|
||||
|
||||
response.close();
|
||||
|
||||
Repository other = getRepository(url);
|
||||
|
||||
assertNotNull(other);
|
||||
@@ -272,10 +277,12 @@ public class RepositoryITCase extends AbstractAdminITCaseBase
|
||||
|
||||
assertNotNull(response);
|
||||
assertTrue(response.getStatus() == 204);
|
||||
response.close();
|
||||
wr = createResource(client, "repositories/".concat(id));
|
||||
response = wr.get(ClientResponse.class);
|
||||
assertNotNull(response);
|
||||
assertTrue(response.getStatus() == 404);
|
||||
response.close();
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
@@ -299,6 +306,7 @@ public class RepositoryITCase extends AbstractAdminITCaseBase
|
||||
|
||||
Repository repository = response.getEntity(Repository.class);
|
||||
|
||||
response.close();
|
||||
assertNotNull(repository);
|
||||
|
||||
return repository;
|
||||
@@ -324,6 +332,7 @@ public class RepositoryITCase extends AbstractAdminITCaseBase
|
||||
|
||||
Repository repository = response.getEntity(Repository.class);
|
||||
|
||||
response.close();
|
||||
assertNotNull(repository);
|
||||
|
||||
return repository;
|
||||
|
||||
@@ -104,6 +104,7 @@ public class UserITCase extends AbstractAdminITCaseBase
|
||||
|
||||
assertNotNull(response);
|
||||
assertTrue(response.getStatus() == 204);
|
||||
response.close();
|
||||
|
||||
User other = getUser(marvin.getName());
|
||||
|
||||
@@ -134,15 +135,16 @@ public class UserITCase extends AbstractAdminITCaseBase
|
||||
public void getAll()
|
||||
{
|
||||
WebResource wr = createResource(client, "users");
|
||||
ClientResponse respone = wr.get(ClientResponse.class);
|
||||
ClientResponse response = wr.get(ClientResponse.class);
|
||||
|
||||
assertNotNull(respone);
|
||||
assertTrue(respone.getStatus() == 200);
|
||||
assertNotNull(response);
|
||||
assertTrue(response.getStatus() == 200);
|
||||
|
||||
Collection<User> users =
|
||||
respone.getEntity(new GenericType<Collection<User>>() {}
|
||||
response.getEntity(new GenericType<Collection<User>>() {}
|
||||
);
|
||||
|
||||
response.close();
|
||||
assertNotNull(users);
|
||||
assertFalse(users.isEmpty());
|
||||
|
||||
@@ -175,6 +177,7 @@ public class UserITCase extends AbstractAdminITCaseBase
|
||||
|
||||
assertNotNull(response);
|
||||
assertTrue(response.getStatus() == 201);
|
||||
response.close();
|
||||
|
||||
User other = getUser(user.getName());
|
||||
|
||||
@@ -198,10 +201,12 @@ public class UserITCase extends AbstractAdminITCaseBase
|
||||
|
||||
assertNotNull(response);
|
||||
assertTrue(response.getStatus() == 204);
|
||||
response.close();
|
||||
wr = createResource(client, "users/".concat(user.getName()));
|
||||
response = wr.get(ClientResponse.class);
|
||||
assertNotNull(response);
|
||||
assertTrue(response.getStatus() == 404);
|
||||
response.close();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -230,13 +235,14 @@ public class UserITCase extends AbstractAdminITCaseBase
|
||||
private User getUser(String username)
|
||||
{
|
||||
WebResource wr = createResource(client, "users/".concat(username));
|
||||
ClientResponse respone = wr.get(ClientResponse.class);
|
||||
ClientResponse response = wr.get(ClientResponse.class);
|
||||
|
||||
assertNotNull(respone);
|
||||
assertTrue(respone.getStatus() == 200);
|
||||
assertNotNull(response);
|
||||
assertTrue(response.getStatus() == 200);
|
||||
|
||||
User user = respone.getEntity(User.class);
|
||||
User user = response.getEntity(User.class);
|
||||
|
||||
response.close();
|
||||
assertNotNull(user);
|
||||
|
||||
return user;
|
||||
|
||||
Reference in New Issue
Block a user