Ejemplo n.º 1
0
  @Test
  @Transactional
  public void updateMethod_payment() throws Exception {
    // Initialize the database
    method_paymentRepository.saveAndFlush(method_payment);

    int databaseSizeBeforeUpdate = method_paymentRepository.findAll().size();

    // Update the method_payment
    method_payment.setName(UPDATED_NAME);
    method_payment.setDecription(UPDATED_DECRIPTION);
    method_payment.setCreate_date(UPDATED_CREATE_DATE);

    restMethod_paymentMockMvc
        .perform(
            put("/api/method_payments")
                .contentType(TestUtil.APPLICATION_JSON_UTF8)
                .content(TestUtil.convertObjectToJsonBytes(method_payment)))
        .andExpect(status().isOk());

    // Validate the Method_payment in the database
    List<Method_payment> method_payments = method_paymentRepository.findAll();
    assertThat(method_payments).hasSize(databaseSizeBeforeUpdate);
    Method_payment testMethod_payment = method_payments.get(method_payments.size() - 1);
    assertThat(testMethod_payment.getName()).isEqualTo(UPDATED_NAME);
    assertThat(testMethod_payment.getDecription()).isEqualTo(UPDATED_DECRIPTION);
    assertThat(testMethod_payment.getCreate_date()).isEqualTo(UPDATED_CREATE_DATE);
  }
Ejemplo n.º 2
0
  @Test
  @Transactional
  public void createMethod_payment() throws Exception {
    int databaseSizeBeforeCreate = method_paymentRepository.findAll().size();

    // Create the Method_payment

    restMethod_paymentMockMvc
        .perform(
            post("/api/method_payments")
                .contentType(TestUtil.APPLICATION_JSON_UTF8)
                .content(TestUtil.convertObjectToJsonBytes(method_payment)))
        .andExpect(status().isCreated());

    // Validate the Method_payment in the database
    List<Method_payment> method_payments = method_paymentRepository.findAll();
    assertThat(method_payments).hasSize(databaseSizeBeforeCreate + 1);
    Method_payment testMethod_payment = method_payments.get(method_payments.size() - 1);
    assertThat(testMethod_payment.getName()).isEqualTo(DEFAULT_NAME);
    assertThat(testMethod_payment.getDecription()).isEqualTo(DEFAULT_DECRIPTION);
    assertThat(testMethod_payment.getCreate_date()).isEqualTo(DEFAULT_CREATE_DATE);
  }