mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 14:35:45 +01:00
change NamespaceStrategy signature to createNamespace(Repository)
This change allows us to implement NamespaceStrategies, such as by type (git, hg, svn) or manual defined. The DefaultNamespaceStrategy accepts now a predefined namespace and only if no namespace was set the username of the currently logged in user is used.
This commit is contained in:
@@ -17,8 +17,16 @@ public class DefaultNamespaceStrategyTest {
|
||||
|
||||
@Test
|
||||
@SubjectAware(username = "trillian", password = "secret")
|
||||
public void testNamespaceStrategy() {
|
||||
assertEquals("trillian", namespaceStrategy.getNamespace());
|
||||
public void testNamespaceStrategyWithoutPreset() {
|
||||
assertEquals("trillian", namespaceStrategy.createNamespace(new Repository()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@SubjectAware(username = "trillian", password = "secret")
|
||||
public void testNamespaceStrategyWithPreset() {
|
||||
Repository repository = new Repository();
|
||||
repository.setNamespace("awesome");
|
||||
assertEquals("awesome", namespaceStrategy.createNamespace(repository));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user