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