improve modification handler events by sending old and new items to eventbus

This commit is contained in:
Sebastian Sdorra
2014-01-11 13:45:23 +01:00
parent 23d2c1f27c
commit c3100f420c
17 changed files with 361 additions and 252 deletions

View File

@@ -44,7 +44,7 @@ import org.junit.Before;
import org.junit.Test;
import sonia.scm.AbstractTestBase;
import sonia.scm.HandlerEvent;
import sonia.scm.HandlerEventType;
import sonia.scm.user.User;
import sonia.scm.user.UserEvent;
@@ -101,7 +101,7 @@ public class GuavaScmEventBusTest extends AbstractTestBase
}
});
eventBus.post(new UserEvent(new User("test"), HandlerEvent.CREATE));
eventBus.post(new UserEvent(HandlerEventType.CREATE, new User("test")));
assertNotEquals(thread, currentThread);
}

View File

@@ -41,7 +41,7 @@ import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import sonia.scm.HandlerEvent;
import sonia.scm.HandlerEventType;
import static org.mockito.Mockito.*;
@@ -118,7 +118,7 @@ public class UserEventHackTest
*/
private void fireEvent(UserManager u)
{
UserEventHack.fireEvent(u, new User(), HandlerEvent.CREATE);
UserEventHack.fireEvent(u, HandlerEventType.CREATE, new User());
}
/**
@@ -129,8 +129,8 @@ public class UserEventHackTest
*/
private void verify(int count)
{
verifier.verify(userManager, calls(count)).fireEvent(any(User.class),
any(HandlerEvent.class));
verifier.verify(userManager,
calls(count)).fireEvent(any(HandlerEventType.class), any(User.class));
}
//~--- fields ---------------------------------------------------------------