@Test void map_fromObject() { var pet = new Pet(); pet.setPetId(PET_ID); pet.setName(PET_NAME); pet.setPetType(PET_TYPE); pet.setStatus(PetStatus.AVAILABLE); var petDTO = PET_MAPPER.map(pet); Assertions.assertAll(() -> { Assertions.assertNotNull(petDTO); Assertions.assertEquals(pet.getPetId(), petDTO.getPetId()); Assertions.assertEquals(pet.getName(), petDTO.getName()); Assertions.assertEquals(pet.getPetType(), petDTO.getPetType()); Assertions.assertEquals(pet.getStatus().name(), petDTO.getStatus().name()); }); }
public Pet map(PetDTO dto) { var pet = new Pet(); pet.setPetId(dto.getPetId()); pet.setName(dto.getName()); pet.setPetType(dto.getPetType()); pet.setStatus(PetStatus.valueOf(dto.getStatus().name())); return pet; }
PetMapper { public Pet map(PetDTO dto) { var pet = new Pet(); pet.setPetId(dto.getPetId()); pet.setName(dto.getName()); pet.setPetType(dto.getPetType()); pet.setStatus(PetStatus.valueOf(dto.getStatus().name())); return pet; } }
PetMapper { public Pet map(PetDTO dto) { var pet = new Pet(); pet.setPetId(dto.getPetId()); pet.setName(dto.getName()); pet.setPetType(dto.getPetType()); pet.setStatus(PetStatus.valueOf(dto.getStatus().name())); return pet; }  }
PetMapper { public Pet map(PetDTO dto) { var pet = new Pet(); pet.setPetId(dto.getPetId()); pet.setName(dto.getName()); pet.setPetType(dto.getPetType()); pet.setStatus(PetStatus.valueOf(dto.getStatus().name())); return pet; }  Pet map(PetDTO dto); PetDTO map(Pet pet); }
PetMapper { public Pet map(PetDTO dto) { var pet = new Pet(); pet.setPetId(dto.getPetId()); pet.setName(dto.getName()); pet.setPetType(dto.getPetType()); pet.setStatus(PetStatus.valueOf(dto.getStatus().name())); return pet; }  Pet map(PetDTO dto); PetDTO map(Pet pet);  }