class TravisRestService {

  public void finish(long buildId) throws Exception {
    jandyWorker.put(buildId, JandyTask.FINISH, Long.valueOf(buildId));
  }

}

class TravisRestServiceTest {

  @Autowired
  private TravisRestService travisRestService;
  @MockBean
  private ProfContextDumpRepository profContextDumpRepository;
  @MockBean
  private ProjectRepository projectRepository;
  @MockBean
  private BranchRepository branchRepository;
  @MockBean
  private BuildRepository buildRepository;
  @MockBean
  private JandyWorker jandyWorker;
  @MockBean
  private SampleRepository sampleRepository;
  private BuildInfo bi;
  private Project project;
  private Branch branch;

  @Test
  public void testFinish() throws Exception {

    travisRestService.finish(1L);

    verify(jandyWorker, times(1)).put(eq(1L), eq(JandyTask.FINISH), eq(Long.valueOf(1L)));
  }

}