TicketMapper { public NewTicketEntity convert(TicketInput ticketInput) { final NewTicketEntity ticketEntity = new NewTicketEntity(); ticketEntity.setApi(ticketInput.getApi()); ticketEntity.setApplication(ticketInput.getApplication()); ticketEntity.setContent(ticketInput.getContent()); if (ticketInput.getCopyToSender() != null) { ticketEntity.setCopyToSender(ticketInput.getCopyToSender()); } ticketEntity.setSubject(ticketInput.getSubject()); return ticketEntity; }  NewTicketEntity convert(TicketInput ticketInput);  }
@Test public void testConvert() { TicketMapper ticketMapper = new TicketMapper(); TicketInput input = new TicketInput() .api(TICKET_API) .application(TICKET_APPLICATION) .content(TICKET_CONTENT) .subject(TICKET_SUBJECT) .copyToSender(Boolean.TRUE); NewTicketEntity ticketEntity = ticketMapper.convert(input); assertNotNull(ticketEntity); assertEquals(TICKET_API, ticketEntity.getApi()); assertEquals(TICKET_APPLICATION, ticketEntity.getApplication()); assertEquals(TICKET_CONTENT, ticketEntity.getContent()); assertEquals(TICKET_SUBJECT, ticketEntity.getSubject()); assertTrue(ticketEntity.isCopyToSender()); }