Package fm.last.citrine.service

Source Code of fm.last.citrine.service.TaskManagerImplTest

package fm.last.citrine.service;

import static org.mockito.Mockito.verify;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import fm.last.citrine.dao.TaskDAO;
import fm.last.citrine.model.Task;
import fm.last.citrine.scheduler.SchedulerManager;

@RunWith(MockitoJUnitRunner.class)
public class TaskManagerImplTest {

  @Mock
  private TaskDAO taskDAO;
  @Mock
  private SchedulerManager schedulerManager;
 
  private TaskManager taskManager;
 
  @Before
  public void setUp() throws Exception {
    taskManager = new TaskManagerImpl(taskDAO, schedulerManager);
  }

  @Test
  public void testSaveNewTask() {
    Task task = new Task("taskName", "groupName", "beanName");
    taskManager.save(task);
    verify(schedulerManager).scheduleTask(task, true);
    verify(taskDAO).save(task);
  }
}
TOP

Related Classes of fm.last.citrine.service.TaskManagerImplTest

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.