@Test void map_fromDTO() { var petDTO = new PetDTO(); petDTO.setPetId(PET_ID); petDTO.setName(PET_NAME); petDTO.setPetType(PET_TYPE); petDTO.setStatus(PetStatusDTO.AVAILABLE); var pet = PET_MAPPER.map(petDTO); Assertions.assertAll(() -> { Assertions.assertNotNull(pet); Assertions.assertEquals(petDTO.getPetId(), pet.getPetId()); Assertions.assertEquals(petDTO.getName(), pet.getName()); Assertions.assertEquals(petDTO.getPetType(), pet.getPetType()); Assertions.assertEquals(petDTO.getStatus().name(), pet.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);  }