Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test): Update EbeanAspectDaoTest.java #11580

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.linkedin.metadata.EbeanTestUtils;
import com.linkedin.metadata.aspect.batch.AspectsBatch;
import com.linkedin.metadata.config.EbeanConfiguration;
import com.linkedin.metadata.entity.EbeanEntityServiceTest;
import io.ebean.Database;
import io.ebean.test.LoggedSql;
import java.util.List;
Expand All @@ -24,7 +23,7 @@ public class EbeanAspectDaoTest {

@BeforeMethod
public void setupTest() {
Database server = EbeanTestUtils.createTestServer(EbeanEntityServiceTest.class.getSimpleName());
Database server = EbeanTestUtils.createTestServer(EbeanAspectDaoTest.class.getSimpleName());
testDao = new EbeanAspectDao(server, EbeanConfiguration.testDefault);
}

Expand All @@ -34,7 +33,8 @@ public void testGetNextVersionForUpdate() {

testDao.runInTransactionWithRetryUnlocked(
(txContext) -> {
testDao.getNextVersions(Map.of("urn:li:corpuser:test", Set.of("status")));
testDao.getNextVersions(
Map.of("urn:li:corpuser:testGetNextVersionForUpdate", Set.of("status")));
return "";
},
mock(AspectsBatch.class),
Expand All @@ -43,9 +43,9 @@ public void testGetNextVersionForUpdate() {
// Get the captured SQL statements
List<String> sql =
LoggedSql.stop().stream()
.filter(str -> str.contains("(t0.urn,t0.aspect,t0.version)"))
.filter(str -> str.contains("testGetNextVersionForUpdate"))
.toList();
assertEquals(sql.size(), 1, String.format("Found: %s", sql));
assertEquals(sql.size(), 2, String.format("Found: %s", sql));
assertTrue(
sql.get(0).contains("for update;"), String.format("Did not find `for update` in %s ", sql));
}
Expand Down
Loading