@Test
public void itFailsBuildOfBranchWithNoActiveModules() throws Exception {

  // no malformed files no active modules
  when(malformedFileService.getMalformedFiles(anyInt())).thenReturn(ImmutableSet.of());
  when(moduleService.getByBranch(1)).thenReturn(ImmutableSet.of(inactiveModule));
  boolean[] repoBuildFailed = {false};
  doAnswer(invocation -> {
    RepositoryBuild build = (RepositoryBuild) invocation.getArguments()[0];
    assertThat(build).isEqualTo(launchingBuild);
    repoBuildFailed[0] = true;
    return null;
  }).when(repositoryBuildService).fail(any());
  buildVisitor.visitLaunching(launchingBuild);
  assertThat(repoBuildFailed[0]).isTrue();
}