forked from plusone/plusone-commons
修改测试类。
parent
e0d793ba14
commit
0067fce7af
|
@ -1,11 +1,12 @@
|
||||||
package xyz.zhouxy.plusone.commons.util;
|
package xyz.zhouxy.plusone.commons.util;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
@ -51,10 +52,10 @@ class JdbcUtilTests {
|
||||||
Connection conn = this.dataSource.getConnection();
|
Connection conn = this.dataSource.getConnection();
|
||||||
List<DbRecord> rs = JdbcUtil.connect(conn).queryToRecordList(
|
List<DbRecord> rs = JdbcUtil.connect(conn).queryToRecordList(
|
||||||
"SELECT * FROM public.base_table WHERE id IN (?, ?, ?)", 501533, 501554, 544599);
|
"SELECT * FROM public.base_table WHERE id IN (?, ?, ?)", 501533, 501554, 544599);
|
||||||
assertEquals(3, rs.size());
|
assertTrue(3 > rs.size());
|
||||||
for (DbRecord baseEntity : rs) {
|
for (DbRecord baseEntity : rs) {
|
||||||
log.info("id: {}", baseEntity.getValueAsLong("id"));
|
log.info("id: {}", baseEntity.getValueAsLong("id"));
|
||||||
assertNull(baseEntity.getValueAsString("updated_by"));
|
assertEquals(Optional.empty(), baseEntity.getValueAsString("updated_by"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue