Search in sources :

Example 1 with ApplicationLinks

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

the class ApplicationMapperTest method testApplicationLinks.

@Test
public void testApplicationLinks() {
    String basePath = "/" + APPLICATION;
    ApplicationLinks links = applicationMapper.computeApplicationLinks(basePath, null);
    assertNotNull(links);
    assertEquals(basePath, links.getSelf());
    assertEquals(basePath + "/members", links.getMembers());
    assertEquals(basePath + "/notifications", links.getNotifications());
    assertEquals(basePath + "/picture", links.getPicture());
}
Also used : ApplicationLinks(io.gravitee.rest.api.portal.rest.model.ApplicationLinks) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.Test)

Example 2 with ApplicationLinks

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

the class ApplicationMapper method computeApplicationLinks.

public ApplicationLinks computeApplicationLinks(String basePath, OffsetDateTime updateDate) {
    ApplicationLinks applicationLinks = new ApplicationLinks();
    applicationLinks.setMembers(basePath + "/members");
    applicationLinks.setNotifications(basePath + "/notifications");
    applicationLinks.setPicture(basePath + "/picture" + (updateDate == null ? "" : "?" + updateDate.hashCode()));
    applicationLinks.setBackground(basePath + "/background" + (updateDate == null ? "" : "?" + updateDate.hashCode()));
    applicationLinks.setSelf(basePath);
    return applicationLinks;
}
Also used : ApplicationLinks(io.gravitee.rest.api.portal.rest.model.ApplicationLinks)

Aggregations

ApplicationLinks (io.gravitee.rest.api.portal.rest.model.ApplicationLinks)2 Test (org.junit.Test)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1