Adding check for 95% of classes being covered by junits (and supporting test coverage); Update filesystem s3 tests to reuse localstack docker container

This commit is contained in:
2022-08-12 18:55:58 -05:00
parent 52121cc4f3
commit 83c1bd8028
20 changed files with 639 additions and 33 deletions

View File

@ -29,6 +29,7 @@ import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp;
@ -277,8 +278,6 @@ public class QueryManager
*******************************************************************************/
public static SimpleEntity executeStatementForSimpleEntity(Connection connection, String sql, Object... params) throws SQLException
{
throw (new NotImplementedException());
/*
PreparedStatement statement = prepareStatementAndBindParams(connection, sql, params);
statement.execute();
ResultSet resultSet = statement.getResultSet();
@ -290,7 +289,6 @@ public class QueryManager
{
return (null);
}
*/
}
@ -355,8 +353,6 @@ public class QueryManager
*******************************************************************************/
public static SimpleEntity buildSimpleEntity(ResultSet resultSet) throws SQLException
{
throw (new NotImplementedException());
/*
SimpleEntity row = new SimpleEntity();
ResultSetMetaData metaData = resultSet.getMetaData();
@ -365,7 +361,6 @@ public class QueryManager
row.put(metaData.getColumnName(i), getObject(resultSet, i));
}
return row;
*/
}

View File

@ -360,4 +360,25 @@ class QueryManagerTest
assertEquals(null, QueryManager.executeStatementForSingleValue(connection, Integer.class, "SELECT int_col FROM test_table WHERE int_col IS NULL"));
}
/*******************************************************************************
**
*******************************************************************************/
@Test
void testQueryForSimpleEntity() throws SQLException
{
Connection connection = getConnection();
QueryManager.executeUpdate(connection, """
INSERT INTO test_table
( int_col, datetime_col, char_col, date_col, time_col )
VALUES
( 47, '2022-08-10 19:22:08', 'Q', '2022-08-10', '19:22:08')
""");
SimpleEntity simpleEntity = QueryManager.executeStatementForSimpleEntity(connection, "SELECT * FROM test_table");
assertNotNull(simpleEntity);
assertEquals(47, simpleEntity.get("INT_COL"));
assertEquals("Q", simpleEntity.get("CHAR_COL"));
}
}