@Test
  @Transactional
  public void getCommercialOperation() throws Exception {
    // Initialize the database
    commercialOperationRepository.saveAndFlush(commercialOperation);

    // Get the commercialOperation
    restCommercialOperationMockMvc
        .perform(get("/api/commercialOperations/{id}", commercialOperation.getId()))
        .andExpect(status().isOk())
        .andExpect(content().contentType(MediaType.APPLICATION_JSON))
        .andExpect(jsonPath("$.id").value(commercialOperation.getId().intValue()))
        .andExpect(jsonPath("$.providerCode").value(DEFAULT_PROVIDER_CODE.toString()));
  }
  @Test
  @Transactional
  public void deleteCommercialOperation() throws Exception {
    // Initialize the database
    commercialOperationRepository.saveAndFlush(commercialOperation);

    int databaseSizeBeforeDelete = commercialOperationRepository.findAll().size();

    // Get the commercialOperation
    restCommercialOperationMockMvc
        .perform(
            delete("/api/commercialOperations/{id}", commercialOperation.getId())
                .accept(TestUtil.APPLICATION_JSON_UTF8))
        .andExpect(status().isOk());

    // Validate the database is empty
    List<CommercialOperation> commercialOperations = commercialOperationRepository.findAll();
    assertThat(commercialOperations).hasSize(databaseSizeBeforeDelete - 1);
  }