title: Using non-static injected services in JUnit Parameterized Tests
body: <p>I want to use Guice and GuiceBerry to inject a non-static legacy service into a factory class. I then want to inject that factory into my Parameterized JUnit test. </p>
  
  <p>However, the issue is JUnit requires that the <code>@Parameters</code> method be static. </p>
  
  <p>Example factory:</p>
  
  <pre><code>@Singleton
  public class Ratings {
      @Inject
      private RatingService ratingService;
  
      public Rating classicRating() {
           return ratingService.getRatingById(1002)
      }
  
      // More rating factory methods
  }
  </code></pre>
  
  <p>Example test usage:</p>
  
  <pre><code>@RunWith(Parameterized.class)
  public class StaticInjectParamsTest {
      @Rule
      public GuiceBerryRule guiceBerryRule = new GuiceBerryRule(ExtendedTestMod.class)
  
      @Inject
      private static Ratings ratings;
  
      @Parameter
      public Rating rating;
  
      @Parameters
      public static Collection&lt;Rating[]&gt; ratingsParameters() {
      return Arrays.asList(new Rating[][]{
              {ratings.classicRating()}
              // All the other ratings
          });
      }
  
      @Test
      public void shouldWork() {
          //Use the rating in a test
  
      }
  }
  </code></pre>
  
  <p>I've tried requesting static injection for the factory method but the <code>Parameters</code> method gets called before the GuiceBerry <code>@Rule</code>.  I've also considered using just the rating's Id as the parameters but I want to find a reusable solution.  Maybe my approach is flawed?  </p>