title: Nullpointer when testing components in springBoot 2
body: <p>I have a SpringBoot 2 app with this component</p>
  
  <pre><code>@Component
  @Slf4j
  public class RequestHostelUtils {
  
      private RequestHostelUtils() {
          // Private constructor to hide the implicit public one
      }
  </code></pre>
  
  <p>and this other one</p>
  
  <pre><code>@Component
  public class RequestEntityPredicates {
  
      private final RequestHostelUtils requestHostelUtils;
  
      public RequestEntityPredicates(RequestHostelUtils requestHostelUtils) {
          this.requestHostelUtils = requestHostelUtils;
      }
  </code></pre>
  
  <p>and this Unit Test, that when I test it I git a nullpointer in requestEntityPredicates because requestHostelUtils is null;</p>
  
  <pre><code>@RunWith(MockitoJUnitRunner.class)
  @Slf4j
      public class RequestEntityValidatorsTests {
  
          @Autowired
          private RequestHostelUtils requestHostelUtils;
  
          private RequestEntityPredicates requestEntityPredicates;
  
  
  
      @Before
      public void setUp() throws Exception {
          requestEntityPredicates = new RequestEntityPredicates(requestHostelUtils);
      }
  </code></pre>
  
  <p>I also tried </p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @SpringBootTest(classes = { Application.class })
  @Slf4j
   public class RequestEntityValidatorsTests {
  </code></pre>
  
  <p>with the same results</p>