diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2019-03-04 14:30:34 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2019-03-06 11:30:44 +0100 |
commit | 052e3b08498bb3c42aaabaaeea2325dfb03e2bac (patch) | |
tree | c930a336d2a0868f9df5188d4caf0738ed99c145 | |
parent | 088275d877e6463df05a8efd62f1aad91f9dc3dd (diff) | |
download | sonarqube-052e3b08498bb3c42aaabaaeea2325dfb03e2bac.tar.gz sonarqube-052e3b08498bb3c42aaabaaeea2325dfb03e2bac.zip |
Fix UT on Oracle
-rw-r--r-- | server/sonar-db-dao/src/test/java/org/sonar/db/alm/OrganizationAlmBindingDaoTest.java | 21 |
1 files changed, 5 insertions, 16 deletions
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 |