### Question:
QueueServiceImpl implements QueueService { @Override public Future<BuildResult> enqueueBuild(UserIdentity committer, Repository repository, String sha1, String command, boolean force) throws Exception { if (!shouldBuild(repository, sha1, force)) { return null; } Pair<Repository, String> target = new Pair<Repository, String>(findBuildPlace(repository), sha1); Task<BuildResult> task = builder.get(committer, repository, target, command); Key k = pipeline.submit(task); tracker.put(k, target); return pipeline.getFuture(k); } @Inject  QueueServiceImpl(Context context, StatusesService statusService, Pipeline pipeline,
			BuildTaskProvider builder); @Override Future<BuildResult> enqueueBuild(UserIdentity committer, Repository repository,
			String sha1, String command, boolean force); @Override void addCallback(BuildLifeCycleListener callback); @Override void removeCallback(BuildLifeCycleListener callback); @Override Collection<Pair<Repository, String>> getCurrentTasks(); @Override Collection<Pair<Repository, String>> getScheduledTasks();  }### Answer:
@Test public void testEnqueueBuild_force_onOKs() throws Exception { String sha1 = "0123401234012340123401234012340123401234"; String cmd = "0123456789012345678901234567890123456789"; boolean force = true; List<Status> statuses = Arrays.asList(Status.OK); given(statusService.getStatus(repo, sha1)).willReturn(statuses); Future<BuildResult> future = buildQueueServiceImpl.enqueueBuild(committer, repo, sha1, cmd, force); assertThat(future).isNotNull(); assertThat( enqueue(true, Arrays.asList(Status.OK)) ).isNotNull(); }
@Test public void testEnqueueBuild() throws Exception { assertThat( enqueue(false, Arrays.<Status>asList()) ).isNotNull(); }