@Test(dependsOnMethods = "createCustomer") private void readCustomer() { customerCrudService = (CustomerCrudService) ctx.getBean("customerCrudService"); // Get Tax Table By ID Customer customer = customerCrudService.findById(id); // Do assertions Assert.assertEquals(customer.getCustomerNumber(), "TH66666"); }
@Test(dependsOnMethods = "readCustomer") private void updateCustomer() { customerCrudService = (CustomerCrudService) ctx.getBean("customerCrudService"); Customer customer = customerCrudService.findById(id); customer.setCustomerNumber("TY77777"); // Update the Record in the Database customerCrudService.merge(customer); // Retrive the UPdata Record Customer updatedCustomer = customerCrudService.findById(id); // Test if the Change Happened Assert.assertEquals(updatedCustomer.getCustomerNumber(), "TY77777"); }