From c8cc8b9c2ad4d50945cbd221d07f96ddc3604841 Mon Sep 17 00:00:00 2001 From: Sven Hettwer Date: Fri, 12 Apr 2019 13:54:02 +0200 Subject: [PATCH] (citrusframework/citrus-db#28) Added getBlob --- .../db/driver/JdbcCallableStatement.java | 8 +++---- .../db/driver/JdbcCallableStatementTest.java | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/driver/src/main/java/com/consol/citrus/db/driver/JdbcCallableStatement.java b/driver/src/main/java/com/consol/citrus/db/driver/JdbcCallableStatement.java index 2b8adc5..793749e 100644 --- a/driver/src/main/java/com/consol/citrus/db/driver/JdbcCallableStatement.java +++ b/driver/src/main/java/com/consol/citrus/db/driver/JdbcCallableStatement.java @@ -181,8 +181,8 @@ public Ref getRef(final int parameterIndex) throws SQLException { @Override public Blob getBlob(final int parameterIndex) throws SQLException { - notSupported("getBlob(int parameterIndex)"); - return null; + prepareResultSet(); + return resultSet.getBlob(parameterIndex); } @Override @@ -464,8 +464,8 @@ public Ref getRef(final String parameterName) throws SQLException { @Override public Blob getBlob(final String parameterName) throws SQLException { - notSupported("getBlob(String parameterName)"); - return null; + prepareResultSet(); + return resultSet.getBlob(parameterName); } @Override diff --git a/driver/src/test/java/com/consol/citrus/db/driver/JdbcCallableStatementTest.java b/driver/src/test/java/com/consol/citrus/db/driver/JdbcCallableStatementTest.java index 31cbd54..f2dfccb 100644 --- a/driver/src/test/java/com/consol/citrus/db/driver/JdbcCallableStatementTest.java +++ b/driver/src/test/java/com/consol/citrus/db/driver/JdbcCallableStatementTest.java @@ -867,6 +867,28 @@ public void testGetClobByName() { verify(resultSetSpy).getClob(TEST_VALUE_NAME); } + @Test + public void testGetBlobByIndex() throws SQLException { + + //WHEN + callableStatement.getBlob(TEST_VALUE_INDEX); + + //THEN + verify(resultSetSpy).next(); + verify(resultSetSpy).getBlob(TEST_VALUE_INDEX); + } + + @Test + public void testGetBlobByName() throws SQLException { + + //WHEN + callableStatement.getBlob(TEST_VALUE_NAME); + + //THEN + verify(resultSetSpy).next(); + verify(resultSetSpy).getBlob(TEST_VALUE_NAME); + } + @Test public void testToString(){ ToStringVerifier