content: package com.homihq.db2rest.rest.oracle;
  
  import com.homihq.db2rest.OracleBaseIntegrationTest;
  import org.junit.jupiter.api.ClassOrderer;
  import org.junit.jupiter.api.DisplayName;
  import org.junit.jupiter.api.Order;
  import org.junit.jupiter.api.Test;
  import org.junit.jupiter.api.TestClassOrder;
  import org.springframework.http.MediaType;
  
  import java.util.Map;
  
  import static com.homihq.db2rest.rest.RdbmsRestApi.VERSION;
  import static java.nio.charset.StandardCharsets.UTF_8;
  import static org.hamcrest.Matchers.equalTo;
  import static org.hamcrest.Matchers.hasSize;
  import static org.hamcrest.Matchers.instanceOf;
  import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
  import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.post;
  import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
  import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
  import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
  
  @TestClassOrder(ClassOrderer.OrderAnnotation.class)
  @Order(250)
  class OracleProcedureControllerTest extends OracleBaseIntegrationTest {
  
      @Test
      @DisplayName("Execute stored procedure on oracle db")
      void execute() throws Exception {
          var json = """ 
                         {
                             "movieTitle": "ACADEMY DINOSAUR"
                         }
                  """;
  
          mockMvc.perform(post(VERSION + "/oradb/procedure/GetMovieRentalRateProc")
                          .characterEncoding(UTF_8)
                          .contentType(MediaType.APPLICATION_JSON)
                          .accept(MediaType.APPLICATION_JSON)
                          .content(json))
                  .andExpect(status().isOk())
                  .andExpect(jsonPath("$", instanceOf(Map.class)))
                  .andExpect(jsonPath("$.*", hasSize(1)))
                  .andExpect(jsonPath("$.P_RENTAL_RATE", equalTo(0.99)))
                  //.andDo(print())
                  .andDo(document("oracle-execute-procedure"));
      }
  
      @Test
      @DisplayName("Execute stored procedure UpdateUserProc on oracle db ")
      void executeUpdateUserProc() throws Exception {
          var json = """ 
                         {
                             "userId": 1
                      }
                  """;
  
          mockMvc.perform(post(VERSION + "/oradb/procedure/UpdateUserProc")
                          .characterEncoding(UTF_8)
                          .contentType(MediaType.APPLICATION_JSON)
                          .accept(MediaType.APPLICATION_JSON)
                          .content(json))
                  .andExpect(status().isOk())
                  .andDo(print())
                  .andExpect(jsonPath("$", instanceOf(Map.class)))
                  .andExpect(jsonPath("$.*", hasSize(1)))
                  .andDo(document("oracle-execute-update-user-proc"));
      }
  }
  