use of org.b3log.solo.service.UserQueryService in project solo by b3log.
the class ErrorProcessorTestCase method init.
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
final InitService initService = getInitService();
final JSONObject requestJSONObject = new JSONObject();
requestJSONObject.put(User.USER_EMAIL, "test@gmail.com");
requestJSONObject.put(User.USER_NAME, "Admin");
requestJSONObject.put(User.USER_PASSWORD, "pass");
initService.init(requestJSONObject);
final UserQueryService userQueryService = getUserQueryService();
Assert.assertNotNull(userQueryService.getUserByEmail("test@gmail.com"));
}
use of org.b3log.solo.service.UserQueryService in project solo by b3log.
the class IndexProcessorTestCase method init.
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
final InitService initService = getInitService();
final JSONObject requestJSONObject = new JSONObject();
requestJSONObject.put(User.USER_EMAIL, "test@gmail.com");
requestJSONObject.put(User.USER_NAME, "Admin");
requestJSONObject.put(User.USER_PASSWORD, "pass");
initService.init(requestJSONObject);
final UserQueryService userQueryService = getUserQueryService();
Assert.assertNotNull(userQueryService.getUserByEmail("test@gmail.com"));
}
use of org.b3log.solo.service.UserQueryService in project solo by b3log.
the class TagProcessorTestCase method init.
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
final InitService initService = getInitService();
final JSONObject requestJSONObject = new JSONObject();
requestJSONObject.put(User.USER_EMAIL, "test@gmail.com");
requestJSONObject.put(User.USER_NAME, "Admin");
requestJSONObject.put(User.USER_PASSWORD, "pass");
initService.init(requestJSONObject);
final UserQueryService userQueryService = getUserQueryService();
Assert.assertNotNull(userQueryService.getUserByEmail("test@gmail.com"));
}
use of org.b3log.solo.service.UserQueryService in project solo by b3log.
the class ProcessAuthAdvice method doAdvice.
@Override
public void doAdvice(final HTTPRequestContext context, final Map<String, Object> args) throws RequestProcessAdviceException {
final LatkeBeanManager beanManager = Lifecycle.getBeanManager();
final UserQueryService userQueryService = beanManager.getReference(UserQueryService.class);
if (!userQueryService.isLoggedIn(context.getRequest(), context.getResponse())) {
try {
context.getResponse().sendError(HttpServletResponse.SC_FORBIDDEN);
} catch (final IOException e) {
throw new RuntimeException(e);
}
throw new RequestReturnAdviceException(null);
}
}
use of org.b3log.solo.service.UserQueryService in project solo by b3log.
the class ArticleProcessorTestCase method init.
/**
* Init.
*
* @throws Exception exception
*/
@Test
public void init() throws Exception {
final InitService initService = getInitService();
final JSONObject requestJSONObject = new JSONObject();
requestJSONObject.put(User.USER_EMAIL, "test@gmail.com");
requestJSONObject.put(User.USER_NAME, "Admin");
requestJSONObject.put(User.USER_PASSWORD, "pass");
initService.init(requestJSONObject);
final UserQueryService userQueryService = getUserQueryService();
Assert.assertNotNull(userQueryService.getUserByEmail("test@gmail.com"));
}
Aggregations