Skip to content

Commit

Permalink
fix(test): Update EbeanAspectDaoTest.java (#11580)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-leifker authored Oct 9, 2024
1 parent e5643d5 commit 51f5e17
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit 51f5e17

Please sign in to comment.