0

I have a class X, which is instantiated runtime from my code.

Class X {
    @Autowired
    Map xyz;

   //Other code
}

Now I have some code that instantiates it:

Class Y {
  public void someMethod() {
   X object = new X();
   object.doSomething();
}

Now, I am writing tests for class Y, which in turn instantiates class X. Is there a way I can Mock the autowired map(in X)?

Bulbasaur
  • 696
  • 1
  • 14
  • 22

0 Answers0