Search in sources :

Example 56 with ApplicationDTO

use of org.wso2.micro.gateway.tests.common.model.ApplicationDTO in project identity-api-user by wso2.

the class UserSessionToExternal method apply.

@Override
public SessionDTO apply(UserSession userSession) {
    List<ApplicationDTO> appDTOs = userSession.getApplications().stream().map(new ApplicationToExternal()).collect(Collectors.toList());
    SessionDTO session = new SessionDTO();
    session.setApplications(appDTOs);
    session.setIp(userSession.getIp());
    session.setLastAccessTime(userSession.getLastAccessTime());
    session.setLoginTime(userSession.getLoginTime());
    session.setUserAgent(userSession.getUserAgent());
    session.setId(userSession.getSessionId());
    return session;
}
Also used : ApplicationDTO(org.wso2.carbon.identity.rest.api.user.session.v1.dto.ApplicationDTO) SessionDTO(org.wso2.carbon.identity.rest.api.user.session.v1.dto.SessionDTO)

Aggregations

BeforeClass (org.testng.annotations.BeforeClass)17 ApplicationDTO (org.wso2.micro.gateway.tests.common.model.ApplicationDTO)17 Application (org.wso2.carbon.apimgt.core.models.Application)11 ApplicationDTO (org.wso2.carbon.apimgt.rest.api.store.dto.ApplicationDTO)11 ArrayList (java.util.ArrayList)10 JSONObject (org.json.JSONObject)10 HashMap (java.util.HashMap)9 Application (org.wso2.carbon.apimgt.api.model.Application)8 API (org.wso2.micro.gateway.tests.common.model.API)8 APIStore (org.wso2.carbon.apimgt.core.api.APIStore)7 ExportedApplication (org.wso2.carbon.apimgt.rest.api.store.v1.models.ExportedApplication)7 KeyValidationInfo (org.wso2.micro.gateway.tests.common.KeyValidationInfo)7 MockAPIPublisher (org.wso2.micro.gateway.tests.common.MockAPIPublisher)7 Test (org.junit.Test)6 APIConsumer (org.wso2.carbon.apimgt.api.APIConsumer)6 ApplicationKeysDTO (org.wso2.carbon.apimgt.rest.api.store.dto.ApplicationKeysDTO)6 ApplicationDTO (org.wso2.carbon.apimgt.rest.api.store.v1.dto.ApplicationDTO)6 APIManagementException (org.wso2.carbon.apimgt.api.APIManagementException)5 WorkflowResponse (org.wso2.carbon.apimgt.core.api.WorkflowResponse)5 ApplicationCreationResponse (org.wso2.carbon.apimgt.core.workflow.ApplicationCreationResponse)5