package at.kugel.tool.buildtray.action;
import org.junit.Test;
import at.kugel.tool.buildtray.status.SetStatusAble;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
public class ActionCommandTest {
@Test
public void shouldReportErrorToTheStatus() {
SetStatusAble statusDisplay = mock(SetStatusAble.class);
new ActionCommand(null, statusDisplay) {
@Override
protected void workTemplate() throws Exception {
throw new IllegalArgumentException("simulates a problem");
}
}.execute();
verify(statusDisplay).setError(any(Exception.class));
}
}