From f8513a5e3f5433a8401356769999184c9b5f4b6f Mon Sep 17 00:00:00 2001 From: "Henning P. Schmiedehausen" Date: Mon, 5 Jun 2023 22:15:05 -0700 Subject: [PATCH] fix checkstyle problems --- .../oracle12/TestGetGeneratedKeysOracle.java | 8 ++--- .../jdbi/v3/oracle12/TestOracleReturning.java | 30 ++++++++--------- .../v3/oracle12/TestOutparameterCursor.java | 32 +++++++++---------- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/test/java/org/jdbi/v3/oracle12/TestGetGeneratedKeysOracle.java b/src/test/java/org/jdbi/v3/oracle12/TestGetGeneratedKeysOracle.java index 3f44a90..2e57fc4 100644 --- a/src/test/java/org/jdbi/v3/oracle12/TestGetGeneratedKeysOracle.java +++ b/src/test/java/org/jdbi/v3/oracle12/TestGetGeneratedKeysOracle.java @@ -40,7 +40,7 @@ * This test uses an oracle instance in a testcontainer. */ @Testcontainers -@EnabledOnOs(architectures = { "x86_64", "amd64"} ) +@EnabledOnOs(architectures = {"x86_64", "amd64"}) public class TestGetGeneratedKeysOracle { @Container @@ -48,15 +48,15 @@ public class TestGetGeneratedKeysOracle { @RegisterExtension public JdbiExtension oracleExtension = JdbiTestcontainersExtension.instance(oc) - .withPlugin(new SqlObjectPlugin()); + .withPlugin(new SqlObjectPlugin()); @BeforeEach public void beforeEach() { Handle handle = oracleExtension.getSharedHandle(); handle.execute( - "create sequence something_id_sequence INCREMENT BY 1 START WITH 100"); + "create sequence something_id_sequence INCREMENT BY 1 START WITH 100"); handle.execute( - "create table something (name varchar(200), id int, constraint something_id primary key (id))"); + "create table something (name varchar(200), id int, constraint something_id primary key (id))"); } /** diff --git a/src/test/java/org/jdbi/v3/oracle12/TestOracleReturning.java b/src/test/java/org/jdbi/v3/oracle12/TestOracleReturning.java index a66d257..2425eb7 100644 --- a/src/test/java/org/jdbi/v3/oracle12/TestOracleReturning.java +++ b/src/test/java/org/jdbi/v3/oracle12/TestOracleReturning.java @@ -38,7 +38,7 @@ * This test uses an oracle instance in a testcontainer. */ @Testcontainers -@EnabledOnOs(architectures = { "x86_64", "amd64"} ) +@EnabledOnOs(architectures = {"x86_64", "amd64"}) public class TestOracleReturning { @Container @@ -46,15 +46,15 @@ public class TestOracleReturning { @RegisterExtension public JdbiExtension oracleExtension = JdbiTestcontainersExtension.instance(oc) - .withPlugin(new SqlObjectPlugin()); + .withPlugin(new SqlObjectPlugin()); @BeforeEach public void beforeEach() { Handle handle = oracleExtension.getSharedHandle(); handle.execute( - "create sequence something_id_sequence INCREMENT BY 1 START WITH 100"); + "create sequence something_id_sequence INCREMENT BY 1 START WITH 100"); handle.execute( - "create table something (name varchar(200), id int, constraint something_id primary key (id))"); + "create table something (name varchar(200), id int, constraint something_id primary key (id))"); } @Test @@ -63,12 +63,12 @@ public void testReturningDmlPositionalParams() { try (Update update = h.createUpdate("insert into something(id, name) values (?, ?) returning id into ?")) { List ids = update - .bind(0, 17) - .bind(1, "Brian") - .addCustomizer(returnParameters().register(2, OracleTypes.INTEGER)) - .execute(returningDml()) - .mapTo(int.class) - .list(); + .bind(0, 17) + .bind(1, "Brian") + .addCustomizer(returnParameters().register(2, OracleTypes.INTEGER)) + .execute(returningDml()) + .mapTo(int.class) + .list(); assertThat(ids).containsExactly(17); } @@ -80,11 +80,11 @@ public void testReturningDmlNamedParams() { try (Update update = h.createUpdate("insert into something(id, name) values (:id, :name) returning id into :result")) { List ids = update - .bindBean(new Something(20, "Brian")) - .addCustomizer(returnParameters().register("result", OracleTypes.INTEGER)) - .execute(returningDml()) - .mapTo(int.class) - .list(); + .bindBean(new Something(20, "Brian")) + .addCustomizer(returnParameters().register("result", OracleTypes.INTEGER)) + .execute(returningDml()) + .mapTo(int.class) + .list(); assertThat(ids).containsExactly(20); } diff --git a/src/test/java/org/jdbi/v3/oracle12/TestOutparameterCursor.java b/src/test/java/org/jdbi/v3/oracle12/TestOutparameterCursor.java index 67846f2..017ffb1 100644 --- a/src/test/java/org/jdbi/v3/oracle12/TestOutparameterCursor.java +++ b/src/test/java/org/jdbi/v3/oracle12/TestOutparameterCursor.java @@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat; @Testcontainers -@EnabledOnOs(architectures = { "x86_64", "amd64"} ) +@EnabledOnOs(architectures = {"x86_64", "amd64"}) public class TestOutparameterCursor { @Container @@ -40,27 +40,27 @@ public class TestOutparameterCursor { @RegisterExtension JdbiExtension oracleExtension = JdbiTestcontainersExtension.instance(oc) - .withInitializer((ds, h) -> { - h.execute("CREATE TABLE USERS (ID INTEGER, NAME VARCHAR(255))"); - h.execute("INSERT INTO USERS VALUES (1, 'Alice')"); - h.execute("INSERT INTO USERS VALUES (2, 'Bob')"); - h.execute("CREATE OR REPLACE PROCEDURE get_user_by_name(\n" - + "p_name IN USERS.NAME%TYPE,\n" - + "o_c_dbuser OUT SYS_REFCURSOR) " - + "AS\n" - + "BEGIN\n" - + "OPEN o_c_dbuser FOR\n" - + "SELECT * FROM USERS WHERE NAME LIKE p_name || '%';\n" - + "END;"); - }); + .withInitializer((ds, h) -> { + h.execute("CREATE TABLE USERS (ID INTEGER, NAME VARCHAR(255))"); + h.execute("INSERT INTO USERS VALUES (1, 'Alice')"); + h.execute("INSERT INTO USERS VALUES (2, 'Bob')"); + h.execute("CREATE OR REPLACE PROCEDURE get_user_by_name(\n" + + "p_name IN USERS.NAME%TYPE,\n" + + "o_c_dbuser OUT SYS_REFCURSOR) " + + "AS\n" + + "BEGIN\n" + + "OPEN o_c_dbuser FOR\n" + + "SELECT * FROM USERS WHERE NAME LIKE p_name || '%';\n" + + "END;"); + }); @Test public void someTest() throws Exception { RowMapper userMapper = ConstructorMapper.of(User.class); try (Call call = oracleExtension.getSharedHandle().createCall("call get_user_by_name(:a,:b)") - .bind("a", "Alice") - .registerOutParameter("b", Types.REF_CURSOR)) { + .bind("a", "Alice") + .registerOutParameter("b", Types.REF_CURSOR)) { List result = call.invoke(outParameters -> { return outParameters.getRowSet("b").map(userMapper).list(); });