Skip to content

Commit

Permalink
Fix oracle db stored procedure call
Browse files Browse the repository at this point in the history
  • Loading branch information
souravroy committed Nov 20, 2024
1 parent 7b0cd7f commit 2bd3907
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
@TestClassOrder(ClassOrderer.OrderAnnotation.class)
@Order(250)
class OracleProcedureControllerTest extends OracleBaseIntegrationTest {

@Disabled

@Test
@DisplayName("Execute stored procedure on oracle db")
void execute() throws Exception {
Expand All @@ -36,8 +35,8 @@ void execute() throws Exception {
.content(json))
.andExpect(status().isOk())
.andExpect(jsonPath("$", instanceOf(Map.class)))
.andExpect(jsonPath("$.*", hasSize(2)))
.andExpect(jsonPath("$.rentalRate", equalTo(0.99)))
.andExpect(jsonPath("$.*", hasSize(1)))
.andExpect(jsonPath("$.P_RENTAL_RATE", equalTo(0.99)))
//.andDo(print())
.andDo(document("oracle-execute-procedure"));
}
Expand Down
2 changes: 1 addition & 1 deletion api-rest/src/test/resources/oracle/oracle-sakila.sql
Original file line number Diff line number Diff line change
Expand Up @@ -779,4 +779,4 @@ WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-20002,
'Error getting rental rate: ' || SQLERRM);
END GetMovieRentalRateProc;
/

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public Map<String, Object> execute(String dbId, String subRoutineName, Map<Strin
private Map<String, Object> doExecuteInternal(JdbcTemplate jdbcTemplate,
String subRoutineName, Map<String, Object> inParams) {
jdbcTemplate.setResultsMapCaseInsensitive(true);
SqlParameterSource in = new MapSqlParameterSource().addValues(inParams);

try {
return new SimpleJdbcCall(jdbcTemplate).withProcedureName(subRoutineName).execute(inParams);
Expand Down

0 comments on commit 2bd3907

Please sign in to comment.