Search in sources :

Example 1 with NewTicketEntity

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());
}
Also used : TicketInput(io.gravitee.rest.api.portal.rest.model.TicketInput) NewTicketEntity(io.gravitee.rest.api.model.NewTicketEntity) Test(org.junit.Test)

Example 2 with NewTicketEntity

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;
}
Also used : NewTicketEntity(io.gravitee.rest.api.model.NewTicketEntity)

Aggregations

NewTicketEntity (io.gravitee.rest.api.model.NewTicketEntity)2 TicketInput (io.gravitee.rest.api.portal.rest.model.TicketInput)1 Test (org.junit.Test)1