title: Failing while testing autowired field using Junit
body: <p>Am new for Junit, any solution for below issue is welcomed.
  I have a main class like,</p>
  
  <pre><code>@Service
  public class MainClass extends AbstractClass {
  
  @Autowired
  ClassA a;
  
  @Autowired
  ObjectMapper mapper;
  
  public void methodA(){
  ....
  AnotherClass obj= (AnotherClass)mapper.readerFor(AnotherClass.class).readValue(SOME_CODE);
  .......
  }
  </code></pre>
  
  <p>Test Class is,</p>
  
  <pre><code>@RunWith(PowerMockRunner.class)
  @PrepareForTest({MainClass.class})
  public class MainClassTest {
  
  @Mock
  ClassA a;
  
  @Mock
  ObjectMapper mapper;
  
  @InjectMocks
  MainClass process = new MainClass();
  
  //I have to do somthing for Autowired mapper class of main in test class as well
  
  @Test
  public void testProcessRequest() throws Exception{
      process.methodA()
  }
  </code></pre>
  
  <p>Am getting null for mapper object in main class while testing, Yes am aware that I haven't dne any kind of initialization.
  Is there a better way for writing the junit mapper.
  Note : I tried @Mock for ObjectMapper which throws exception at "readerFor".
  Thanks in advance.</p>