title: Mockito.mockConstruction does not return the mocked object
body: <p>I don't want to use powermock anymore. Because junit5 started mocking static classes. So i am trying to get rid of powermock methods.</p>
  <p>As you know, you can create an instance of a class with whenNew keyword. So i decided to use &quot; mockConstruction &quot; . But mockConstruction does not return the mocked object. It doesn't go inside the try block.</p>
  <p>This is my BeforeEach method:</p>
  <pre><code> @BeforeEach
      void setUp() {
          partUnlinkService =
              spy(new PartVideoUnlinkService(part1, part2,
                  part3));
      }
  </code></pre>
  <p>This is my test method:</p>
  <pre><code>  @Test
      void shouldThrowException() throws Exception {
          //given
          UrlLinkDto urlLinkDto =
              UrlPartLinkDto.builder().callId(&quot;333&quot;).videoId(&quot;5555544&quot;).build();
          ArgumentCaptor&lt;UrlPartLinkDto&gt; argumentCaptor = ArgumentCaptor.forClass(UrlPartLinkDto.class);
          //when
          try (MockedConstruction&lt;ObjectMapper&gt; ignoredVariable = mockConstruction(ObjectMapper.class,
              (objectMapper, context) -&gt; {
                  //then
                  partUnlinkService.unlink(urlLinkDto, false);
                  verify(partLogCheckService, times(1)).checkForExistingVideo(
                      urlLinkDto.getVideoId());
                  verify(objectMapper, times(1)).writeValueAsString(argumentCaptor.capture());
                  Throwable throwable =
                      catchThrowable(() -&gt; objectMapper.writeValueAsString(argumentCaptor.capture()));
                  assertThat(throwable).isInstanceOf(JsonProcessingException.class);
              })) {
          } 
      }
  </code></pre>
  <p>Any help would be appreciated.</p>