Search in sources :

Example 46 with User

use of org.neo4j.ogm.domain.gh368.User in project camel-quarkus by apache.

the class OpenstackKeystoneUserResource method createShouldSucceed.

@Path("/createShouldSucceed")
@POST
public void createShouldSucceed() {
    LOG.debug("Calling OpenstackKeystoneUserResource.createShouldSucceed()");
    User in = Builders.user().name(USER_NAME).domainId(USER_DOMAIN_ID).email(USER_EMAIL).enabled(true).build();
    String uri = String.format(URI_FORMAT, OpenstackConstants.CREATE);
    User out = template.requestBody(uri, in, User.class);
    assertNotNull(out);
    assertEquals(USER_NAME, out.getName());
    assertEquals(USER_DOMAIN_ID, out.getDomainId());
    assertEquals(USER_EMAIL, out.getEmail());
    assertTrue(out.isEnabled());
    assertEquals(USER_ID, out.getId());
}
Also used : User(org.openstack4j.model.identity.v3.User) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Example 47 with User

use of org.neo4j.ogm.domain.gh368.User in project petals-se-flowable by petalslink.

the class GetUserOperation method doExecute.

@Override
public GetUserResponse doExecute(final GetUser incomingObject) throws Exception {
    final UserQuery userQuery = this.identityService.createUserQuery();
    userQuery.userId(incomingObject.getId());
    final List<org.flowable.idm.api.User> users = userQuery.list();
    if (users.isEmpty()) {
        throw new UnknownUserException(incomingObject.getId());
    } else {
        final org.flowable.idm.api.User foundUser = users.get(0);
        final User user = new User();
        user.setId(foundUser.getId());
        user.setFirstName(foundUser.getFirstName());
        user.setLastName(foundUser.getLastName());
        user.setEmail(foundUser.getEmail());
        final GetUserResponse response = new GetUserResponse();
        response.setUser(user);
        return response;
    }
}
Also used : UnknownUser(org.ow2.petals.components.flowable.generic._1.UnknownUser) User(org.ow2.petals.components.flowable.generic._1.User) GetUser(org.ow2.petals.components.flowable.generic._1.GetUser) GetUserResponse(org.ow2.petals.components.flowable.generic._1.GetUserResponse) UserQuery(org.flowable.idm.api.UserQuery) UnknownUserException(org.ow2.petals.flowable.incoming.integration.exception.UnknownUserException)

Example 48 with User

use of org.neo4j.ogm.domain.gh368.User in project petals-se-flowable by petalslink.

the class GetUserInvocationTest method invalidRequest_WsdlCompliantRequest.

/**
 * <p>
 * Check the processing of the integration service {@link GetUserOperation} when:
 * </p>
 * <ul>
 * <li>an invalid request is sent,</li>
 * <li>the request content is compliant to the XML schema defined in WSDL</li>
 * </ul>
 * <p>
 * Expected results:
 * </p>
 * <ul>
 * <li>no error occurs</li>
 * <li>a fault occurs about the invalid request</li>
 * </ul>
 */
@Test
public void invalidRequest_WsdlCompliantRequest() throws Exception {
    // We use a response as request
    final GetUserResponse request = new GetUserResponse();
    request.setUser(new User());
    this.testInvalidRequest_WsdlCompliant(NATIVE_USER_SVC_CFG, ITG_USER_PORT_TYPE, ITG_USER_SERVICE, ITG_OP_GETUSER, request);
}
Also used : UnknownUser(org.ow2.petals.components.flowable.generic._1.UnknownUser) GetUser(org.ow2.petals.components.flowable.generic._1.GetUser) User(org.ow2.petals.components.flowable.generic._1.User) GetUserResponse(org.ow2.petals.components.flowable.generic._1.GetUserResponse) Test(org.junit.Test)

Example 49 with User

use of org.neo4j.ogm.domain.gh368.User in project gsfw by Cstone-studio.

the class LoginController method login.

@ApiOperation(value = "用户登录")
@PostMapping(value = "/login")
public R login(@Validated @RequestBody UserLoginDTO userLoginDTO) {
    User user = userService.login(userLoginDTO);
    if (null == user || user.getDeleted()) {
        return R.error(CodeEnum.IS_FAIL.getCode(), "用户名或密码错误");
    }
    // 创建token
    String token = jwtTokenUtil.generateToken(new JwtUser(user));
    user.setToken(token);
    userService.loginSuccess(user);
    Map<String, String> result = new HashMap<>();
    result.put("token", token);
    result.put("userId", String.valueOf(user.getId()));
    return R.success(result);
}
Also used : User(com.gs.model.entity.jpa.db1.User) JwtUser(com.gs.third.jwt.JwtUser) HashMap(java.util.HashMap) JwtUser(com.gs.third.jwt.JwtUser) PostMapping(org.springframework.web.bind.annotation.PostMapping) ApiOperation(io.swagger.annotations.ApiOperation)

Example 50 with User

use of org.neo4j.ogm.domain.gh368.User in project mybatis-issues by harawata.

the class ConfPropWithSpringTest method shouldGetAUser.

@Test
public void shouldGetAUser() {
    User user = mapper.getUser(1);
    Assert.assertEquals("User1", user.getName());
}
Also used : User(issue723.User) Test(org.junit.Test)

Aggregations

User (pl.plajer.villagedefense3.User)30 Player (org.bukkit.entity.Player)18 User (org.gluu.oxtrust.model.scim2.User)17 Test (org.junit.Test)17 User (org.openstack4j.model.identity.v3.User)13 EventHandler (org.bukkit.event.EventHandler)11 GluuCustomPerson (org.gluu.oxtrust.model.GluuCustomPerson)10 ScimPatchUser (org.gluu.oxtrust.model.scim2.ScimPatchUser)10 Date (java.util.Date)9 Arena (pl.plajer.villagedefense3.arena.Arena)8 User (me.zhanghai.android.douya.network.api.info.apiv2.User)7 User (com.google.api.ads.admanager.axis.v202202.User)6 SimpleUser (me.zhanghai.android.douya.network.api.info.apiv2.SimpleUser)6 DuplicateEntryException (org.gluu.site.ldap.exception.DuplicateEntryException)6 Test (org.junit.jupiter.api.Test)6 ArrayList (java.util.ArrayList)5 Path (javax.ws.rs.Path)5 User (org.apache.archiva.redback.rest.api.model.v2.User)5 UserInfo (org.apache.archiva.redback.rest.api.model.v2.UserInfo)5 PersonRequiredFieldsException (org.gluu.oxtrust.exception.PersonRequiredFieldsException)5