@Test public void testCreateAndGetPet() throws Exception { Pet pet = createRandomPet(); api.addPet(pet); Pet fetched = api.getPetById(pet.getId()); assertNotNull(fetched); assertEquals(pet.getId(), fetched.getId()); assertNotNull(fetched.getCategory()); assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); }
@Test public void testUpdatePet() throws Exception { Pet pet = createRandomPet(); pet.setName("programmer"); api.updatePet(pet); Pet fetched = api.getPetById(pet.getId()); assertNotNull(fetched); assertEquals(pet.getId(), fetched.getId()); assertNotNull(fetched.getCategory()); assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); }