From: Julien Lancelot Date: Mon, 4 Mar 2019 13:30:34 +0000 (+0100) Subject: Fix UT on Oracle X-Git-Tag: 7.7~100 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=052e3b08498bb3c42aaabaaeea2325dfb03e2bac;p=sonarqube.git Fix UT on Oracle --- diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/alm/OrganizationAlmBindingDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/alm/OrganizationAlmBindingDaoTest.java index a390b8327e1..b104f9a6dd4 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/alm/OrganizationAlmBindingDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/alm/OrganizationAlmBindingDaoTest.java @@ -33,7 +33,6 @@ import org.sonar.db.user.UserDto; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.entry; import static org.assertj.core.groups.Tuple.tuple; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -173,21 +172,11 @@ public class OrganizationAlmBindingDaoTest { underTest.insert(db.getSession(), organization, almAppInstall, "http://myorg.com", user.getUuid(), true); - assertThat(db.selectFirst(db.getSession(), - "select" + - " uuid as \"uuid\", organization_uuid as \"organizationUuid\", alm_app_install_uuid as \"almAppInstallUuid\", url as \"url\", alm_id as \"almId\"," + - " user_uuid as \"userUuid\", members_sync_enabled as \"membersSync\", created_at as \"createdAt\"" + - " from organization_alm_bindings" + - " where organization_uuid='" + organization.getUuid() + "'")) - .contains( - entry("uuid", "ABCD"), - entry("organizationUuid", organization.getUuid()), - entry("almAppInstallUuid", almAppInstall.getUuid()), - entry("almId", "github"), - entry("url", "http://myorg.com"), - entry("userUuid", user.getUuid()), - entry("createdAt", NOW), - entry("membersSync", true)); + assertThat(underTest.selectByOrganizationUuid(db.getSession(), organization.getUuid()).get()) + .extracting(OrganizationAlmBindingDto::getUuid, OrganizationAlmBindingDto::getOrganizationUuid, OrganizationAlmBindingDto::getAlmAppInstallUuid, + OrganizationAlmBindingDto::getAlm, + OrganizationAlmBindingDto::getUrl, OrganizationAlmBindingDto::getUserUuid, OrganizationAlmBindingDto::isMembersSyncEnable, OrganizationAlmBindingDto::getCreatedAt) + .containsExactlyInAnyOrder("ABCD", organization.getUuid(), almAppInstall.getUuid(), GITHUB, "http://myorg.com", user.getUuid(), true, NOW); } @Test