title: Mock UserContext and FacesContext - jUnit
body: <p>I'm trying to write some basic backingBean tests but I'm stuck with mocking the UserContext and facesContext.</p>
  
  <p>This code is in the code that I'm trying to test:</p>
  
  <pre><code>UserContext uc = ContextProvider.getContext();
  Locale locale = uc.getLocale();
  ResourceBundle bundle = ResourceBundle.getBundle("AppMessages", locale);
  String message = bundle.getString("this.is.the.message.key");
  </code></pre>
  
  <p>In another block of code I've got the following:</p>
  
  <pre><code>FacesContext fc = FacesContext.getCurrentInstance();
  fc.getExternalContext().redirect(handleRedirect("someString"));
  </code></pre>
  
  <p>How could I mock these in a standard jUnit test using only mockito? Or do I have to use something like PowerMock?</p>