Skip to content
Snippets Groups Projects
Commit f4c455c7 authored by srosse's avatar srosse
Browse files

no-jira: fix a unit test which fail randomly because Grizzly change its...

no-jira: fix a unit test which fail randomly because Grizzly change its HtppSession during processing the request
parent 58258489
No related branches found
No related tags found
No related merge requests found
......@@ -135,16 +135,12 @@ public class UserWebService {
public Response getUserListQuery(@QueryParam("login") String login, @QueryParam("authProvider") String authProvider,
@QueryParam("authUsername") String authUsername,
@Context UriInfo uriInfo, @Context HttpServletRequest httpRequest) {
MultivaluedMap<String,String> params = uriInfo.getQueryParameters();
return getUserList(login, authProvider, authUsername, params, uriInfo, httpRequest);
}
private Response getUserList(String login, String authProvider, String authUsername, Map<String,List<String>> params,
UriInfo uriInfo, HttpServletRequest httpRequest) {
if(!isUserManager(httpRequest)) {
return Response.serverError().status(Status.UNAUTHORIZED).build();
}
MultivaluedMap<String,String> params = uriInfo.getQueryParameters();
List<Identity> identities;
//make only a search by authUsername
if(StringHelper.containsNonWhitespace(authProvider) && StringHelper.containsNonWhitespace(authUsername)) {
......
......@@ -94,6 +94,7 @@ public abstract class OlatJerseyTestCase extends OlatTestCase {
private void instantiateGrizzlyWebServer() {
if(webServer == null) {
webServer = new GrizzlyWebServer(PORT);
webServer.useAsynchronousWrite(false);
ServletAdapter sa = new ServletAdapter();
Servlet servletInstance = null;
try {
......@@ -105,7 +106,7 @@ public abstract class OlatJerseyTestCase extends OlatTestCase {
sa.addFilter(new RestApiLoginFilter(), "jerseyfilter", null);
sa.addInitParameter("javax.ws.rs.Application", OlatRestApplication.class.getName());
sa.setContextPath("/" + CONTEXT_PATH);
webServer.addGrizzlyAdapter(sa, null);
webServer.addGrizzlyAdapter(sa, new String[]{""});
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment