title: How to use @InjectMocks and initMocks() with an object that has a required String parameter?
body: <p>Given a component to test that requires a non-mockable class (<code>String</code>) in it's constructor injection, like this:</p>
  <pre class="lang-java prettyprint-override"><code>public class MyService {
      @Inject
      public MyService(String param1, SomeObject param2) {
              ...
      }
  }
  </code></pre>
  <p>I want to use Mockito to test it with a test harness like this:</p>
  <pre class="lang-java prettyprint-override"><code>public class MyServiceTests {
      @Mock
      private SomeObject someObject;
  
      @InjectMocks
      private MyService service;
  
      @Before
      public void setUp() {
          MockitoAnnotations.initMocks(this);
      }
  }
  </code></pre>
  <p>Problem is, I can't <code>@Spy</code> or <code>@Mock</code> Strings (because <code>String</code> is a final class). So how can I use Mockito and &quot;inject&quot; a specific String value for the <code>param1</code> argument to <code>MyService</code>'s constructor (or otherwise test this class that requires a non-null String be passed)?</p>