Search in sources :

Example 6 with ShowWsResponse

use of org.sonarqube.ws.ServerId.ShowWsResponse in project sonarqube by SonarSource.

the class ShowActionTest method return_server_id_info.

@Test
public void return_server_id_info() throws Exception {
    logInAsSystemAdministrator();
    when(generator.validate("home", "127.0.0.1", "1818a1eefb26f9g")).thenReturn(true);
    setAvailableIpAdresses("192.168.1.1", "127.0.0.1");
    insertConfiguration("1818a1eefb26f9g", "home", "127.0.0.1");
    ShowWsResponse response = executeRequest();
    assertThat(response.getServerId()).isEqualTo("1818a1eefb26f9g");
    assertThat(response.getOrganization()).isEqualTo("home");
    assertThat(response.getIp()).isEqualTo("127.0.0.1");
    assertThat(response.getValidIpAddressesList()).containsOnly("192.168.1.1", "127.0.0.1");
    assertThat(response.hasInvalidServerId()).isFalse();
}
Also used : ShowWsResponse(org.sonarqube.ws.ServerId.ShowWsResponse) Test(org.junit.Test)

Aggregations

ShowWsResponse (org.sonarqube.ws.ServerId.ShowWsResponse)6 Test (org.junit.Test)5 GetRequest (org.sonarqube.ws.client.GetRequest)1 WsClient (org.sonarqube.ws.client.WsClient)1 ItUtils.newAdminWsClient (util.ItUtils.newAdminWsClient)1 ItUtils.newWsClient (util.ItUtils.newWsClient)1