use of io.gravitee.rest.api.model.NewGroupEntity in project gravitee-management-rest-api by gravitee-io.
the class GroupsResourceTest method shouldCreate.
@Test
public void shouldCreate() {
reset(groupService);
NewGroupEntity newGroupEntity = new NewGroupEntity();
newGroupEntity.setName("my-group-name");
GroupEntity createdGroup = new GroupEntity();
createdGroup.setId("my-group-id");
doReturn(createdGroup).when(groupService).create(any());
final Response response = envTarget().request().post(Entity.json(newGroupEntity));
assertEquals(HttpStatusCode.CREATED_201, response.getStatus());
assertEquals(envTarget().path("my-group-id").getUri().toString(), response.getHeaders().getFirst(HttpHeaders.LOCATION));
}
Aggregations