I have the following code:
@Override
public long getUniqueId() {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateAndTime= dateFormat.format(new Date());
jdbcTemplate.update(someSqlQuery, dateAndTime);
SimpleJdbcCall jdbcCall = new SimpleJdbcCall(jdbcTemplate).withProcedureName("IDENTITY").withReturnValue();
}
return 0;
}
And I want to write simple unit test but whenever the code reaches the line with SimpleJdbcCall throws exception that "DataSource is not specified". This is my test so far:
@Test
public void testGetBatchId() {
transactionImpl.getUniqueId();
}
What is wrong with my setup?