mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
Create id for all test repositories
This commit is contained in:
@@ -33,147 +33,103 @@
|
|||||||
|
|
||||||
package sonia.scm.repository;
|
package sonia.scm.repository;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Sebastian Sdorra
|
|
||||||
*/
|
|
||||||
public final class RepositoryTestData
|
public final class RepositoryTestData
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs ...
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private RepositoryTestData() {}
|
private RepositoryTestData() {}
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Repository create42Puzzle()
|
public static Repository create42Puzzle()
|
||||||
{
|
{
|
||||||
return create42Puzzle(DummyRepositoryHandler.TYPE_NAME);
|
return create42Puzzle(DummyRepositoryHandler.TYPE_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param type
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Repository create42Puzzle(String type)
|
public static Repository create42Puzzle(String type)
|
||||||
{
|
{
|
||||||
Repository repository = new Repository();
|
return new Builder()
|
||||||
|
.type(type)
|
||||||
repository.setType(type);
|
.contact("douglas.adams@hitchhiker.com")
|
||||||
repository.setContact("douglas.adams@hitchhiker.com");
|
.name("42Puzzle")
|
||||||
repository.setName("42Puzzle");
|
.description("The 42 Puzzle")
|
||||||
repository.setDescription("The 42 Puzzle");
|
.build();
|
||||||
|
|
||||||
return repository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Repository createHappyVerticalPeopleTransporter()
|
public static Repository createHappyVerticalPeopleTransporter()
|
||||||
{
|
{
|
||||||
return createHappyVerticalPeopleTransporter(
|
return createHappyVerticalPeopleTransporter(
|
||||||
DummyRepositoryHandler.TYPE_NAME);
|
DummyRepositoryHandler.TYPE_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param type
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Repository createHappyVerticalPeopleTransporter(String type)
|
public static Repository createHappyVerticalPeopleTransporter(String type)
|
||||||
{
|
{
|
||||||
Repository happyVerticalPeopleTransporter = new Repository();
|
return new Builder()
|
||||||
|
.type(type)
|
||||||
happyVerticalPeopleTransporter.setType(type);
|
.contact("zaphod.beeblebrox@hitchhiker.com")
|
||||||
happyVerticalPeopleTransporter.setContact(
|
.name("happyVerticalPeopleTransporter")
|
||||||
"zaphod.beeblebrox@hitchhiker.com");
|
.description("Happy Vertical People Transporter")
|
||||||
happyVerticalPeopleTransporter.setName("happyVerticalPeopleTransporter");
|
.build();
|
||||||
happyVerticalPeopleTransporter.setDescription(
|
|
||||||
"Happy Vertical People Transporter");
|
|
||||||
|
|
||||||
return happyVerticalPeopleTransporter;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Repository createHeartOfGold()
|
public static Repository createHeartOfGold()
|
||||||
{
|
{
|
||||||
return createHeartOfGold(DummyRepositoryHandler.TYPE_NAME);
|
return createHeartOfGold(DummyRepositoryHandler.TYPE_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param type
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Repository createHeartOfGold(String type)
|
public static Repository createHeartOfGold(String type)
|
||||||
{
|
{
|
||||||
Repository heartOfGold = new Repository();
|
return new Builder()
|
||||||
|
.type(type)
|
||||||
heartOfGold.setType(type);
|
.contact("zaphod.beeblebrox@hitchhiker.com")
|
||||||
heartOfGold.setContact("zaphod.beeblebrox@hitchhiker.com");
|
.name("HeartOfGold")
|
||||||
heartOfGold.setName("HeartOfGold");
|
.description(
|
||||||
heartOfGold.setDescription(
|
"Heart of Gold is the first prototype ship to successfully utilise the revolutionary Infinite Improbability Drive")
|
||||||
"Heart of Gold is the first prototype ship to successfully utilise the revolutionary Infinite Improbability Drive");
|
.build();
|
||||||
heartOfGold.setId("hogId");
|
|
||||||
return heartOfGold;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Repository createRestaurantAtTheEndOfTheUniverse()
|
public static Repository createRestaurantAtTheEndOfTheUniverse()
|
||||||
{
|
{
|
||||||
return createRestaurantAtTheEndOfTheUniverse(
|
return createRestaurantAtTheEndOfTheUniverse(
|
||||||
DummyRepositoryHandler.TYPE_NAME);
|
DummyRepositoryHandler.TYPE_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param type
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Repository createRestaurantAtTheEndOfTheUniverse(String type)
|
public static Repository createRestaurantAtTheEndOfTheUniverse(String type)
|
||||||
{
|
{
|
||||||
|
return new Builder()
|
||||||
|
.type(type)
|
||||||
|
.contact("douglas.adams@hitchhiker.com")
|
||||||
|
.name("RestaurantAtTheEndOfTheUniverse")
|
||||||
|
.description("The Restaurant at the End of the Universe")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class Builder {
|
||||||
|
private static int nextID = 0;
|
||||||
Repository repository = new Repository();
|
Repository repository = new Repository();
|
||||||
|
{
|
||||||
|
repository.setId("ID-" + ++nextID);
|
||||||
|
}
|
||||||
|
|
||||||
|
Builder type(String type) {
|
||||||
repository.setType(type);
|
repository.setType(type);
|
||||||
repository.setContact("douglas.adams@hitchhiker.com");
|
return this;
|
||||||
repository.setName("RestaurantAtTheEndOfTheUniverse");
|
}
|
||||||
repository.setDescription("The Restaurant at the End of the Universe");
|
|
||||||
|
|
||||||
|
Builder contact(String contact) {
|
||||||
|
repository.setContact(contact);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Builder name(String name) {
|
||||||
|
repository.setName(name);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Builder description(String description) {
|
||||||
|
repository.setDescription(description);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Repository build() {
|
||||||
return repository;
|
return repository;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user