Search in sources :

Example 1 with LicenseItem

use of pageobjects.licenses.LicenseItem in project sonarqube by SonarSource.

the class LicensesPageTest method change_licenses.

@Test
public void change_licenses() {
    String EXAMPLE_LICENSE = "TmFtZTogRGV2ZWxvcHBlcnMKUGx1Z2luOiBhdXRvY29udHJvbApFeHBpcmVzOiAyMDEyLTA0LTAxCktleTogNjI5N2MxMzEwYzg2NDZiZTE5MDU1MWE4ZmZmYzk1OTBmYzEyYTIyMgo=";
    LicensesPage page = nav.logIn().asAdmin().openLicenses();
    LicenseItem licenseItem = page.getLicenseByKey("typed.license.secured");
    licenseItem.setLicense(EXAMPLE_LICENSE);
    ValuesWsResponse response = wsClient.settingsService().values(ValuesRequest.builder().setKeys("typed.license.secured").build());
    assertThat(response.getSettings(0).getValue()).isEqualTo(EXAMPLE_LICENSE);
}
Also used : ValuesWsResponse(org.sonarqube.ws.Settings.ValuesWsResponse) LicensesPage(pageobjects.licenses.LicensesPage) LicenseItem(pageobjects.licenses.LicenseItem) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 ValuesWsResponse (org.sonarqube.ws.Settings.ValuesWsResponse)1 LicenseItem (pageobjects.licenses.LicenseItem)1 LicensesPage (pageobjects.licenses.LicensesPage)1