Search in sources :

Example 1 with UserLinks

use of io.gravitee.rest.api.portal.rest.model.UserLinks in project gravitee-management-rest-api by gravitee-io.

the class UserMapperTest method testUserLinks.

@Test
public void testUserLinks() {
    String basePath = "/user";
    UserLinks links = userMapper.computeUserLinks(basePath, null);
    assertNotNull(links);
    assertEquals(basePath, links.getSelf());
    assertEquals(basePath + "/avatar?", links.getAvatar());
    assertEquals(basePath + "/notifications", links.getNotifications());
    assertEquals(basePath, links.getSelf());
}
Also used : UserLinks(io.gravitee.rest.api.portal.rest.model.UserLinks) Test(org.junit.Test)

Example 2 with UserLinks

use of io.gravitee.rest.api.portal.rest.model.UserLinks in project gravitee-management-rest-api by gravitee-io.

the class UserResourceTest method init.

@Before
public void init() throws IOException, URISyntaxException {
    resetAllMocks();
    doReturn(new User()).when(userMapper).convert(nullable(UserEntity.class));
    doReturn(new UserLinks()).when(userMapper).computeUserLinks(any(), any());
    InlinePictureEntity mockImage = new InlinePictureEntity();
    byte[] apiLogoContent = Files.readAllBytes(Paths.get(this.getClass().getClassLoader().getResource("media/logo.svg").toURI()));
    mockImage.setContent(apiLogoContent);
    mockImage.setType("image/svg");
    doReturn(mockImage).when(userService).getPicture(any());
}
Also used : UserLinks(io.gravitee.rest.api.portal.rest.model.UserLinks) User(io.gravitee.rest.api.portal.rest.model.User) UpdateUserEntity(io.gravitee.rest.api.model.UpdateUserEntity) UserEntity(io.gravitee.rest.api.model.UserEntity) InlinePictureEntity(io.gravitee.rest.api.model.InlinePictureEntity) Before(org.junit.Before)

Aggregations

UserLinks (io.gravitee.rest.api.portal.rest.model.UserLinks)2 InlinePictureEntity (io.gravitee.rest.api.model.InlinePictureEntity)1 UpdateUserEntity (io.gravitee.rest.api.model.UpdateUserEntity)1 UserEntity (io.gravitee.rest.api.model.UserEntity)1 User (io.gravitee.rest.api.portal.rest.model.User)1 Before (org.junit.Before)1 Test (org.junit.Test)1