@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); }
@Before public void initTest() { method_payment = new Method_payment(); method_payment.setName(DEFAULT_NAME); method_payment.setDecription(DEFAULT_DECRIPTION); method_payment.setCreate_date(DEFAULT_CREATE_DATE); }
@Test @Transactional public void checkNameIsRequired() throws Exception { int databaseSizeBeforeTest = method_paymentRepository.findAll().size(); // set the field null method_payment.setName(null); // Create the Method_payment, which fails. restMethod_paymentMockMvc .perform( post("/api/method_payments") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(method_payment))) .andExpect(status().isBadRequest()); List<Method_payment> method_payments = method_paymentRepository.findAll(); assertThat(method_payments).hasSize(databaseSizeBeforeTest); }