/*
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.mpalourdio.springboottemplate.service;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class UselessBeanTest {

    @InjectMocks
    private UselessBean uselessBean;

    @Mock
    private ABeanIWantToMock aBeanIWantToMock;

    @Test
    public void testMyMockReturnFalseInTest() {
        Mockito.when(aBeanIWantToMock.iAlwaysReturnFalse()).thenReturn(true);
        Assert.assertTrue(uselessBean.iWantToMockThisMethod());
    }
}

@@ -557,16 +557,41 @@
 Assert;%0A
+import org.junit.Before;%0A
 import o
@@ -605,16 +605,16 @@
 t.Test;%0A
-
 import o
@@ -642,40 +642,8 @@
 th;%0A
-import org.mockito.InjectMocks;%0A
 impo
@@ -808,25 +808,8 @@
  %7B%0A%0A
-    @InjectMocks%0A
     
@@ -852,16 +852,16 @@
   @Mock%0A
-
     priv
@@ -900,16 +900,118 @@
 oMock;%0A%0A
+    @Before%0A    public void setUp() %7B%0A        uselessBean = new UselessBean(aBeanIWantToMock);%0A    %7D%0A%0A
     @Tes

Initialize object under test in setup