@Test public void inject_server_properties() { Configuration config = Configuration.create(); Server server = mock(Server.class); when(server.version()).thenReturn(Version.create("5.2")); when(server.getUrl()).thenReturn("http: Build build = mock(Build.class); when(build.getProperties()).thenReturn(ImmutableMap.of("sonar.projectKey", "SAMPLE", "language", "java")); BuildRunner runner = new BuildRunner(config); runner.runQuietly(server, build); ArgumentCaptor<Map> captor = ArgumentCaptor.forClass(Map.class); verify(build).execute(eq(config), captor.capture()); assertThat(captor.getValue()).containsOnly( entry("sonar.projectKey", "SAMPLE"), entry("sonar.host.url", "http: entry("language", "java"), entry("sonar.scm.disabled", "true"), entry("sonar.branch.autoconfig.disabled", "true")); }
public BuildResult runQuietly(@Nullable Server server, Build<?> build) { return build.execute(config, adjustProperties(server, build)); }
BuildRunner { public BuildResult runQuietly(@Nullable Server server, Build<?> build) { return build.execute(config, adjustProperties(server, build)); } }
BuildRunner { public BuildResult runQuietly(@Nullable Server server, Build<?> build) { return build.execute(config, adjustProperties(server, build)); } BuildRunner(Configuration config); }
BuildRunner { public BuildResult runQuietly(@Nullable Server server, Build<?> build) { return build.execute(config, adjustProperties(server, build)); } BuildRunner(Configuration config); BuildResult runQuietly(@Nullable Server server, Build<?> build); BuildResult run(@Nullable Server server, Build<?> build); }
BuildRunner { public BuildResult runQuietly(@Nullable Server server, Build<?> build) { return build.execute(config, adjustProperties(server, build)); } BuildRunner(Configuration config); BuildResult runQuietly(@Nullable Server server, Build<?> build); BuildResult run(@Nullable Server server, Build<?> build); static final String SONAR_HOST_URL; }