Package at.kugel.tool.buildtray.action

Source Code of at.kugel.tool.buildtray.action.ActionCommandTest

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));
   }
}
TOP

Related Classes of at.kugel.tool.buildtray.action.ActionCommandTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.