Skip to content
Merged
Show file tree
Hide file tree
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,17 +9,6 @@

public class EmbeddedDatabaseRuleSql2oTest {

public static class Element {
public final Long id;

public final String name;

public Element(final Long id, final String name) {
this.id = id;
this.name = name;
}
}

@Rule
public final EmbeddedDatabaseRule databaseRule = EmbeddedDatabaseRule
.builder()
Expand All @@ -28,7 +17,7 @@ public Element(final Long id, final String name) {
.build();

@Test
public void testUsingSql2oWithTransaction() throws Exception {
public void testUsingSql2oWithTransaction() {
final Sql2o sql2o = new Sql2o(databaseRule.getDataSource());
final String elementName = "element illegalSqlFromResource";
try (final Connection transaction = sql2o.beginTransaction()) {
Expand All @@ -41,9 +30,9 @@ public void testUsingSql2oWithTransaction() throws Exception {
transaction.commit();
}
try (final Connection read = sql2o.open()) {
final Element element = read
final TestElement element = read
.createQuery("SELECT * from ELEMENT")
.executeAndFetch(Element.class)
.executeAndFetch(TestElement.class)
.iterator()
.next();
assertEquals(1L, element.id.longValue());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.zapodot.junit.db;

public class TestElement {
public Long id;

public String name;

}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<rxjava-jdbc.version>0.7.19</rxjava-jdbc.version>
<slf4j.version>2.0.13</slf4j.version>
<spring-jdbc.version>6.1.11</spring-jdbc.version>
<sql2o.version>1.6.0</sql2o.version>
<sql2o.version>1.8.0</sql2o.version>
<hamcrest.version>2.2</hamcrest.version>
<cyclonedx-maven-plugin.version>2.8.0</cyclonedx-maven-plugin.version>
</properties>
Expand Down