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());
}
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());
}
Aggregations