### Question:
JdbcDaoTemplate { public void update(String sql, ParameterMapper parameterMapper) { update(sql, false, parameterMapper); } JdbcDaoTemplate(DataSource datasource); List<T> query(String sql, ColumnMapper<T> columnMapper); List<T> query(String sql, ParameterMapper parameterMapper, final ColumnMapper<T> columnMapper); void update(String sql, ParameterMapper parameterMapper); List<Number> insert(String sql, ParameterMapper parameterMapper); List<Number> update(String sql, final boolean returnKey, ParameterMapper parameterMapper); Object execute(String sql, boolean returnKey, ParameterMapper parameterMapper, PreparedCallback preparedCallback); DataSource getDatasource();  }### Answer:
@Test public void testUpdate() throws SQLException { final PreparedStatement mockStatement = mock(PreparedStatement.class); when(mockConnection.prepareStatement("SQL")).thenReturn(mockStatement); final StringBuffer parameter = new StringBuffer(); List<Number> keys = template.update("SQL", false, new ParameterMapper() { @Override public void mapParameters(PreparedStatement statement) throws SQLException { assertSame(mockStatement, statement); parameter.append("parameter"); } }); verify(mockStatement).execute(); assertNull(keys); assertEquals("parameter", parameter.toString()); verify(mockStatement).close(); verify(mockConnection).close(); }