title: isolated testing of backing bean that uses RequestParam without jsf pages
body: <p>I want to do a relatively simple test. The class being tested (simplified but you get the idea): </p>
  
  <pre><code>@Named
  @RequestScoped
  public class SomeController {
  
      @Inject
      @RequestParam("someId")
      Long someId;
  
      public SomeClass getSomeClass() {
  
          return new SomeClass(someId);
      }
  }
  </code></pre>
  
  <p>And the test:</p>
  
  <pre><code>@RunWith(Arquillian.class)
  public class SomeControllerTest {
  
      @Inject
      private SomeController controller;
  
      @Deployment
      public static Archive&lt;?&gt; createTestArchive() throws IOException {
      // trimmed out
  
      }
  
      @Test
      public void testNullGoalModelInjection() {
      //placeholder test so there are no errors during build
  
      // I am happy to use setter injection and do
      controller.setSomeId(1);
  
      // even better if I could get that injected in too
      assertNotNull(controller.getSomeClass());
      }
  
  }
  </code></pre>
  
  <p>In trying, this, I get the exception: </p>
  
  <pre><code>java.lang.IllegalStateException: Attempted to inject an HttpServletRequest before it has been initialized.
  </code></pre>
  
  <p>Which makes sense.</p>
  
  <p>What I am really wondering is:</p>
  
  <p>Is there a way to test such a bean through Arquillian (or something else) without it involving the creation of jsf pages and then using jsfunit / warp / or some other mechanism to invoke a http request?</p>
  
  <p>In other words, how can I invoke a http request through the test which will get this bean generated for me - but without it requiring jsf files and suchlike to be in place.</p>
  
  <p>Thanks for any help / suggestions.</p>