@Test public void return_status_zero_if_run_passes() { Configuration config = Configuration.create(); Server server = mock(Server.class); when(server.version()).thenReturn(Version.create("5.6")); Build build = mock(Build.class); when(build.execute(any(Configuration.class), anyMap())).thenReturn(new BuildResult().addStatus(0)); BuildRunner runner = new BuildRunner(config); BuildResult result = runner.run(server, build); assertThat(result.isSuccess()).isTrue(); }
public BuildResult run(@Nullable Server server, Build<?> build) { BuildResult result = runQuietly(server, build); if (!result.isSuccess()) { throw new BuildFailureException(build, result); } return result; }
BuildRunner { public BuildResult run(@Nullable Server server, Build<?> build) { BuildResult result = runQuietly(server, build); if (!result.isSuccess()) { throw new BuildFailureException(build, result); } return result; } }
BuildRunner { public BuildResult run(@Nullable Server server, Build<?> build) { BuildResult result = runQuietly(server, build); if (!result.isSuccess()) { throw new BuildFailureException(build, result); } return result; } BuildRunner(Configuration config); }
BuildRunner { public BuildResult run(@Nullable Server server, Build<?> build) { BuildResult result = runQuietly(server, build); if (!result.isSuccess()) { throw new BuildFailureException(build, result); } return result; } BuildRunner(Configuration config); BuildResult runQuietly(@Nullable Server server, Build<?> build); BuildResult run(@Nullable Server server, Build<?> build); }
BuildRunner { public BuildResult run(@Nullable Server server, Build<?> build) { BuildResult result = runQuietly(server, build); if (!result.isSuccess()) { throw new BuildFailureException(build, result); } return result; } BuildRunner(Configuration config); BuildResult runQuietly(@Nullable Server server, Build<?> build); BuildResult run(@Nullable Server server, Build<?> build); static final String SONAR_HOST_URL; }