PageRenderTime 105ms CodeModel.GetById 102ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/sitebricks/src/test/java/com/google/sitebricks/TestRequestCreator.java

http://github.com/dhanji/sitebricks
Java | 17 lines | 10 code | 3 blank | 4 comment | 0 complexity | d8bb9413e0fa7eff8c45027eb0953811 MD5 | raw file
 1package com.google.sitebricks;
 2
 3import com.google.inject.Injector;
 4import com.google.inject.util.Providers;
 5import com.google.sitebricks.headless.Request;
 6
 7import javax.servlet.http.HttpServletRequest;
 8
 9/**
10 * @author dhanji@gmail.com (Dhanji R. Prasanna)
11 */
12public class TestRequestCreator {
13  public static Request from(HttpServletRequest request, Injector injector) {
14    // We give null as validator and validationconverter...
15    return new ServletRequestProvider(Providers.of(request), injector, null).get();
16  }
17}