title: @Autowired annotation not able to inject bean in JUnit class
body: <p>my test class:</p>
  
  <pre><code>public class myTest extends TestCase{
  @Autowired
  BeanClass beanObject
  public void beanTest()
  {
  Classdata data = beanObject.getMethod();
  }
  }
  </code></pre>
  
  <p>I am getting a null pointer exception at line: </p>
  
  <pre><code>Classdata data = beanObject.getMethod();
  </code></pre>
  
  <p>the <code>beanObject.getMethod();</code> precisely gives nullpointer exception</p>
  
  <p>How should i make possible the autowiring of the field beanObject in my Junit class so that i can use the methods from the "BeanClass" class?</p>
  
  <hr>
  
  <p>Copied from Comments:</p>
  
  <blockquote>
    <p>in plain terms.. beanClass is an
    interface which has certain methods..
    i have tagged that beanClass with
    <code>@Service("beanObject")</code>
    annotation..that banClass is
    implemented by beanClassImpl class
    which has the method implementations..
    i need to use those implementations in
    my testClass to get the data to be
    compared.. for that i am doing
    <code>@Autowired</code> beanClass beanObject in
    my testClass.. m i going terribly
    wrong somewhere?</p>
  </blockquote>