Skip to content

Commit

Permalink
Merge pull request #3576 from ebean-orm/feature/bump-ebean-test-conta…
Browse files Browse the repository at this point in the history
…iners

#3511 bump ebean-test-containers dependency
  • Loading branch information
rbygrave authored Feb 26, 2025
2 parents e18b59a + 3845861 commit 11e7839
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ public void testWithLazyBatchSize() {
List<String> loggedSql = LoggedSql.stop();

assertEquals(3, loggedSql.size());
assertTrue(trimSql(loggedSql.get(0), 7).contains("select t0.id, t0.status, t0.order_date, t1.id, t1.name from o_order t0 join o_customer t1"));
assertTrue(trimSql(loggedSql.get(1), 7).contains("select t0.order_id, t0.id, t0.order_qty, t0.ship_qty, t0.unit_price"));
assertTrue(trimSql(loggedSql.get(2), 7).contains("select t0.order_id, t0.id, t0.ship_time, t0.cretime, t0.updtime, t0.version, t0.order_id from or_order_ship"));
assertThat(trimSql(loggedSql.get(0), 7)).contains(" t0.id, t0.status, t0.order_date, t1.id, t1.name from o_order t0 join o_customer t1");
assertThat(trimSql(loggedSql.get(1), 7)).contains(" t0.order_id, t0.id, t0.order_qty, t0.ship_qty, t0.unit_price");
assertThat(trimSql(loggedSql.get(2), 7)).contains(" t0.order_id, t0.id, t0.ship_time, t0.cretime, t0.updtime, t0.version, t0.order_id from or_order_ship");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ private void checkWithLazyLoadingOnBuiltInMany() {

// first one is the main query and others are lazy loading queries
List<String> loggedSql = LoggedSql.stop();
assertTrue(loggedSql.size() > 1);
assertThat(loggedSql.size()).isGreaterThan(1);

String lazyLoadSql = loggedSql.get(1);
// contains the foreign key back to the parent bean (t0.order_id)
assertTrue(trimSql(lazyLoadSql, 2).contains("select t0.order_id, t0.id"));
assertTrue(lazyLoadSql.contains("order by t0.order_id, t0.id, t0.order_qty, t0.cretime desc"));
assertThat(trimSql(lazyLoadSql, 2)).contains(" t0.order_id, t0.id");
assertThat(lazyLoadSql).contains("order by t0.order_id, t0.id, t0.order_qty, t0.cretime desc");

}

Expand All @@ -77,8 +77,8 @@ private void checkWithBuiltInMany() {
String sql = query.getGeneratedSql();

// t0.id inserted into the middle of the order by
assertTrue(sql.contains("order by t1.name desc, t0.id, t2.id asc"));
assertTrue(sql.contains("t2.id asc, t2.order_qty asc, t2.cretime desc"));
assertThat(sql).contains("order by t1.name desc, t0.id, t2.id asc");
assertThat(sql).contains("t2.id asc, t2.order_qty asc, t2.cretime desc");
}

private void checkAppendId() {
Expand All @@ -90,7 +90,7 @@ private void checkAppendId() {
String sql = query.getGeneratedSql();

// append the id to ensure ordering of root level objects
assertTrue(sql.contains("order by t1.name desc, t0.id"));
assertThat(sql).contains("order by t1.name desc, t0.id");
}

private void checkNone() {
Expand All @@ -103,8 +103,8 @@ private void checkNone() {

// no need to append id to order by as there is no 'many' included in the
// query
assertTrue(sql.contains("order by t1.name desc"));
assertTrue(!sql.contains("order by t1.name desc,"));
assertThat(sql).contains("order by t1.name desc");
assertThat(sql).doesNotContain("order by t1.name desc,");
}

private void checkBoth() {
Expand All @@ -116,7 +116,7 @@ private void checkBoth() {

String sql = query.getGeneratedSql();
// insert id into the middle of the order by
assertTrue(sql.contains("order by t1.name, t0.id, t2.ship_time desc"));
assertThat(sql).contains("order by t1.name, t0.id, t2.ship_time desc");
}

private void checkPrepend() {
Expand All @@ -128,7 +128,7 @@ private void checkPrepend() {

String sql = query.getGeneratedSql();
// prepend id in order by
assertTrue(sql.contains("order by t0.id, t1.ship_time desc"));
assertThat(sql).contains("order by t0.id, t1.ship_time desc");
}

private void checkAlreadyIncluded() {
Expand All @@ -140,7 +140,7 @@ private void checkAlreadyIncluded() {

String sql = query.getGeneratedSql();
// prepend id in order by
assertTrue(sql.contains("order by t0.id, t1.ship_time desc"));
assertThat(sql).contains("order by t0.id, t1.ship_time desc");
}

private void checkAlreadyIncluded2() {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<ebean-ddl-runner.version>2.3</ebean-ddl-runner.version>
<ebean-migration-auto.version>1.2</ebean-migration-auto.version>
<ebean-migration.version>14.2.0</ebean-migration.version>
<ebean-test-containers.version>7.5</ebean-test-containers.version>
<ebean-test-containers.version>7.6</ebean-test-containers.version>
<ebean-datasource.version>9.0</ebean-datasource.version>
<ebean-agent.version>14.9.0</ebean-agent.version>
<ebean-maven-plugin.version>14.9.0</ebean-maven-plugin.version>
Expand Down

0 comments on commit 11e7839

Please sign in to comment.