use of io.gravitee.rest.api.portal.rest.model.TicketInput 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.portal.rest.model.TicketInput in project gravitee-management-rest-api by gravitee-io.
the class TicketsResourceTest method shouldCreate.
@Test
public void shouldCreate() {
resetAllMocks();
TicketInput input = new TicketInput().subject("A").content("B");
final Response response = target().request().post(Entity.json(input));
assertEquals(HttpStatusCode.CREATED_201, response.getStatus());
assertNull(response.getHeaders().getFirst(HttpHeaders.LOCATION));
verify(ticketMapper).convert(input);
verify(ticketService).create(eq(USER_NAME), any(), eq("DEFAULT"), eq(ParameterReferenceType.ENVIRONMENT));
}
Aggregations