use of io.gravitee.rest.api.model.NewTicketEntity in project gravitee-management-rest-api by gravitee-io.
the class TicketMapperTest method testConvert.
@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());
}
use of io.gravitee.rest.api.model.NewTicketEntity in project gravitee-management-rest-api by gravitee-io.
the class TicketMapper method convert.
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;
}
Aggregations