use of org.sonarqube.ws.Organizations.Organization in project sonarqube by SonarSource.
the class CreateActionTest method verifyResponseAndDb.
private void verifyResponseAndDb(CreateWsResponse response, String id, String name, String key, @Nullable String description, @Nullable String url, @Nullable String avatar, long createdAt) {
Organization organization = response.getOrganization();
assertThat(organization.getName()).isEqualTo(name);
assertThat(organization.getKey()).isEqualTo(key);
if (description == null) {
assertThat(organization.hasDescription()).isFalse();
} else {
assertThat(organization.getDescription()).isEqualTo(description);
}
if (url == null) {
assertThat(organization.hasUrl()).isFalse();
} else {
assertThat(organization.getUrl()).isEqualTo(url);
}
if (avatar == null) {
assertThat(organization.hasAvatar()).isFalse();
} else {
assertThat(organization.getAvatar()).isEqualTo(avatar);
}
OrganizationDto dto = dbClient.organizationDao().selectByUuid(dbTester.getSession(), id).get();
assertThat(dto.getUuid()).isEqualTo(id);
assertThat(dto.getKey()).isEqualTo(key);
assertThat(dto.getName()).isEqualTo(name);
assertThat(dto.getDescription()).isEqualTo(description);
assertThat(dto.getUrl()).isEqualTo(url);
assertThat(dto.getAvatarUrl()).isEqualTo(avatar);
assertThat(dto.getCreatedAt()).isEqualTo(createdAt);
assertThat(dto.getUpdatedAt()).isEqualTo(createdAt);
}
use of org.sonarqube.ws.Organizations.Organization in project sonarlint-core by SonarSource.
the class DefaultRemoteOrganizationTest method testRoundTrip.
@Test
public void testRoundTrip() {
Organization org = Organization.newBuilder().setName("name").setKey("key").setDescription("desc").build();
RemoteOrganization remoteOrg = new DefaultRemoteOrganization(org);
assertThat(remoteOrg.getKey()).isEqualTo("key");
assertThat(remoteOrg.getName()).isEqualTo("name");
assertThat(remoteOrg.getDescription()).isEqualTo("desc");
}
Aggregations