mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
improve integration tests
This commit is contained in:
@@ -35,6 +35,7 @@ package sonia.scm.it;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
@@ -52,6 +53,7 @@ import static sonia.scm.it.IntegrationTestUtil.*;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import com.sun.jersey.api.client.Client;
|
||||
import com.sun.jersey.api.client.ClientResponse;
|
||||
import com.sun.jersey.api.client.GenericType;
|
||||
import com.sun.jersey.api.client.WebResource;
|
||||
@@ -81,6 +83,33 @@ public class RepositoryITCase extends AbstractAdminITCaseBase
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*/
|
||||
@AfterClass
|
||||
public static void cleanup()
|
||||
{
|
||||
Client client = createClient();
|
||||
|
||||
authenticateAdmin(client);
|
||||
|
||||
Collection<Repository> repositories =
|
||||
createResource(client, "repositories").get(
|
||||
new GenericType<Collection<Repository>>() {}
|
||||
);
|
||||
|
||||
if (repositories != null)
|
||||
{
|
||||
for (Repository r : repositories)
|
||||
{
|
||||
createResource(client, "repositories/" + r.getId()).delete();
|
||||
}
|
||||
}
|
||||
|
||||
client.destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user