@Rule
public JenkinsRule j = new JenkinsRule();
@Test
public void shouldWrapUpArguments() throws Exception {
SonarPublisher publisher = mock(SonarPublisher.class);
SonarInstallation installation = mock(SonarInstallation.class);
when(installation.getServerUrl()).thenReturn("hostUrl");
when(installation.getDatabaseUrl()).thenReturn("databaseUrl");
when(installation.getDatabaseDriver()).thenReturn("driver");
when(installation.getDatabaseLogin()).thenReturn("login");
when(installation.getDatabasePassword()).thenReturn("password");
when(installation.getSonarLogin()).thenReturn("sonarlogin");
when(installation.getSonarPassword()).thenReturn("sonarpassword");
when(publisher.getInstallation()).thenReturn(installation);
when(publisher.getBranch()).thenReturn("branch");
when(publisher.getLanguage()).thenReturn("language");
ArgumentListBuilder args = new ArgumentListBuilder();
SonarMaven sonarMaven = new SonarMaven("-Dprop=value", "Default Maven", "pom.xml", "", new DefaultLocalRepositoryLocator(), publisher, mock(BuildListener.class), null, null,
null);
sonarMaven.wrapUpArguments(args, "sonar:sonar", mock(AbstractBuild.class), mock(Launcher.class), mock(BuildListener.class));