Skip to content

Instantly share code, notes, and snippets.

@Pacane
Created February 12, 2016 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pacane/df523f76929ac4f2ed2e to your computer and use it in GitHub Desktop.
Save Pacane/df523f76929ac4f2ed2e to your computer and use it in GitHub Desktop.
package com.arcbees.client.application.services;
import org.jukito.JukitoRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.arcbees.client.application.events.UserDeletedEvent;
import com.google.inject.Inject;
import com.google.web.bindery.event.shared.EventBus;
import static org.mockito.Matchers.isA;
import static org.mockito.Matchers.same;
import static org.mockito.Mockito.verify;
@RunWith(JukitoRunner.class)
public class UserServiceImplTest {
private static final int USER_ID = 4566;
@Inject
private EventBus eventBus;
@Inject
private UserServiceImpl userService;
@Test
public void deleteUser_firesEvent() {
userService.deleteUser(USER_ID);
verify(eventBus).fireEventFromSource(isA(UserDeletedEvent.class), same(userService));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment