mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
fix repository manager tests
This commit is contained in:
@@ -40,7 +40,6 @@ import com.github.legman.Subscribe;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import sonia.scm.HandlerEvent;
|
||||
@@ -66,6 +65,16 @@ public abstract class RepositoryManagerTestBase
|
||||
extends ManagerTestBase<Repository, RepositoryException>
|
||||
{
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param repository
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public abstract HookContext createHookContext(Repository repository);
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -346,7 +355,6 @@ public abstract class RepositoryManagerTestBase
|
||||
* @throws RepositoryException
|
||||
*/
|
||||
@Test
|
||||
@Ignore
|
||||
public void testRepositoryHook() throws RepositoryException, IOException
|
||||
{
|
||||
CountingReceiveHook hook = new CountingReceiveHook();
|
||||
@@ -357,9 +365,7 @@ public abstract class RepositoryManagerTestBase
|
||||
assertEquals(0, hook.eventsReceived);
|
||||
|
||||
Repository repository = createTestRepository();
|
||||
|
||||
// TODO
|
||||
HookContext ctx = null;
|
||||
HookContext ctx = createHookContext(repository);
|
||||
|
||||
repoManager.fireHookEvent(new RepositoryHookEvent(ctx, repository,
|
||||
RepositoryHookType.POST_RECEIVE));
|
||||
@@ -508,12 +514,24 @@ public abstract class RepositoryManagerTestBase
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
@Subscribe
|
||||
@Subscribe(async = false)
|
||||
public void onEvent(PostReceiveRepositoryHookEvent event)
|
||||
{
|
||||
eventsReceived++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
@Subscribe(async = false)
|
||||
public void onEvent(PreReceiveRepositoryHookEvent event)
|
||||
{
|
||||
eventsReceived++;
|
||||
}
|
||||
|
||||
//~--- fields -------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
|
||||
Reference in New Issue
Block a user