protected RoleList defaultRoleList() { // Having an empty role list is not valid, they should always have one role Role role = new Role(); role.setName("derpRole"); role.setId("9"); role.setDescription("Derp description"); RoleList roleList = new RoleList(); roleList.getRole().add(role); return roleList; }
private static AuthenticateResponse getServiceResponse() { AuthenticateResponse rsp = new AuthenticateResponse(); Token token = new Token(); token.setId("tokenid"); GregorianCalendar cal = new GregorianCalendar(2013, 11, 12); token.setExpires(new XMLGregorianCalendarImpl(cal)); TenantForAuthenticateResponse tenantForAuthenticateResponse = new TenantForAuthenticateResponse(); tenantForAuthenticateResponse.setId("tenantId"); tenantForAuthenticateResponse.setName("tenantName"); token.setTenant(tenantForAuthenticateResponse); rsp.setToken(token); ServiceCatalog catalog = new ServiceCatalog(); List<ServiceForCatalog> serviceCatalogList = new ArrayList<>(); ServiceForCatalog serviceForCatalog = new ServiceForCatalog(); serviceForCatalog.setName("catName"); serviceForCatalog.setType("type"); serviceCatalogList.add(serviceForCatalog); catalog.getService().addAll(serviceCatalogList); rsp.setServiceCatalog(catalog); UserForAuthenticateResponse user = new UserForAuthenticateResponse(); user.setId("userId"); user.setName("userName"); RoleList roles = new RoleList(); Role role = new Role(); role.setDescription("role description"); role.setId("roleId"); role.setName("roleName"); role.setServiceId("serviceId"); role.setTenantId("roleTenantId"); roles.getRole().add(role); user.setRoles(roles); rsp.setUser(user); return rsp; }