title: Optional int parameter 'movieId' is present but cannot be translated into a null value
body: <p><strong>I am working on Maven multi module project so this might build error?</strong></p>
  
  <p>I am trying to perform unit test of delete method from controller and I quite don't understand why it is happening here because methods similar to this one works. </p>
  
  <p>Exception speaks for itself - cannot convert int to null. But why there is null value where it looks like curl looks correct? </p>
  
  <pre><code>{"timestamp":"2019-12-16T11:47:35.450+0000","path":"/movie-composite/1","status":500,"error":"Internal Server Error","message":"Optional int parameter 'movieId' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type."}
  </code></pre>
  
  <p>Ho mapping looks like:</p>
  
  <pre><code>/**
   * Sample usage: curl $HOST:$PORT/movie-composite/1
   *
   * @param movieId
   */
  @ApiOperation(
          value = "${api.movie-composite.delete-composite-movie.description}",
          notes = "${api.movie-composite.delete-composite-movie.notes}")
  @ApiResponses(value = {
          @ApiResponse(code = 400, message = "Bad Request, invalid format of the request. See response message for more information."),
          @ApiResponse(code = 422, message = "Unprocessable entity, input parameters caused the processing to fails. See response message for more information.")
  })
  @DeleteMapping(
          value = "/movie-composite/{movieId}",
          produces = "application/json")
  void deleteCompositeMovie(@PathVariable int movieId);
  </code></pre>
  
  <p>its implementation:</p>
  
  <pre><code>@Override
  public void deleteCompositeMovie(int movieId) {
      log.debug("deleteCompositeMovie will delete Movie, Reviews, Recommendations belonging to Movie with id: {}", movieId);
  
      movieCompositeIntegration.deleteMovie(movieId);
      movieCompositeIntegration.deleteReviews(movieId);
      movieCompositeIntegration.deleteRecommendations(movieId);
  
      log.debug("deleteCompositeMovie deleted Movie, Reviews, Recommendations belonging to Movie with id: {}", movieId);
  
  }
  </code></pre>
  
  <p>And finally test that won't pass:</p>
  
  <pre><code>@Test
  void deleteCompositeMovie() {
      int given = 1;
  
      deleteAndVerify(given, HttpStatus.OK);
  
      verify(baseMovieCompositeService, times(1)).deleteCompositeMovie(given);
  }
  </code></pre>
  
  <p>where <strong>deleteAndVerify(given, HttpStatus.OK)</strong> looks like:</p>
  
  <pre><code>private void deleteAndVerify(int id, HttpStatus httpStatus) {
       webTestClient.delete()
              .uri("/movie-composite/" + id)
              .exchange()
              .expectStatus().isEqualTo(httpStatus);
  }
  </code></pre>
  
  <p>complete test file looks like:</p>
  
  <pre><code>@ExtendWith(SpringExtension.class)
  @SpringBootTest(webEnvironment = RANDOM_PORT)
  public class MovieCompositeServiceApplicationTests {
  
      public static final String FAKE_ADDRESS = "Fake address";
      public static final String FAKE_GENRE = "Fake genre";
      public static final String FAKE_TITLE = "Fake title";
      @Autowired
      WebTestClient webTestClient;
  
      @MockBean
      MovieCompositeIntegration movieCompositeIntegration;
  
      @MockBean
      BaseMovieCompositeService baseMovieCompositeService;
  
      @MockBean
      ServiceUtil serviceUtil;
  
      @Test
      void createMovie() {
          int movieId = 1;
  
          MovieAggregate movieAggregate = MovieAggregate.builder()
                  .movieId(movieId)
                  .genre(FAKE_GENRE)
                  .title(FAKE_TITLE)
                  .recommendations(getRecommendationSummaries())
                  .reviews(getReviewSummaries())
                  .serviceAddresses(null)
                  .build();
  
          postAndVerify(movieAggregate);
      }
  
      @Test
      void getMovieById() {
          int given = 1;
  
          Movie movie = getMovies(given);
  
          Mockito.when(serviceUtil.getServiceAddress()).thenReturn("Fake service address");
  
          List&lt;Recommendation&gt; recommendations = getRecommendations(movie);
          List&lt;Review&gt; reviews = getReviews(movie);
  
          Mockito.when(movieCompositeIntegration.getMovie(given)).thenReturn(movie);
          Mockito.when(movieCompositeIntegration.getRecommendations(movie.getMovieId())).thenReturn(recommendations);
          Mockito.when(movieCompositeIntegration.getReviews(movie.getMovieId())).thenReturn(reviews);
  
          getAndVerifyMovie(given, HttpStatus.OK)
                  .jsonPath("$.movieId").isEqualTo(given)
                  .jsonPath("$.recommendations.length()").isEqualTo(3)
                  .jsonPath("$.reviews.length()").isEqualTo(3);
      }
  
      @Test
      void getMovieByIdThrowsNotFoundException() {
          int given = 1;
  
          Mockito.when(movieCompositeIntegration.getMovie(given)).thenThrow(NotFoundException.class);
  
          getAndVerifyMovie(given, HttpStatus.NOT_FOUND)
                  .jsonPath("$.path").isEqualTo("/movie-composite/" + given);
      }
  
      @Test
      void getMovieByIdThrowsInvalidInputException() {
          int given = 1;
  
          Mockito.when(movieCompositeIntegration.getMovie(given)).thenThrow(InvalidInputException.class);
  
          getAndVerifyMovie(given, HttpStatus.UNPROCESSABLE_ENTITY)
                  .jsonPath("$.path").isEqualTo("/movie-composite/" + given);
      }
  
      @Test
      void deleteCompositeMovie() {
          int given = 1;
  
          deleteAndVerify(given, HttpStatus.OK);
  
          verify(baseMovieCompositeService, times(1)).deleteCompositeMovie(given);
      }
  
      private WebTestClient.BodyContentSpec getAndVerifyMovie(int id, HttpStatus status) {
          return webTestClient.get()
                  .uri("/movie-composite/" + id)
                  .accept(MediaType.APPLICATION_JSON_UTF8)
                  .exchange()
                  .expectStatus().isEqualTo(status)
                  .expectHeader().contentType(MediaType.APPLICATION_JSON_UTF8)
                  .expectBody();
      }
  
      private WebTestClient.BodyContentSpec postAndVerify(MovieAggregate movieAggregate) {
          return webTestClient.post()
                  .uri("/movie-composite")
                  .body(just(movieAggregate), MovieAggregate.class)
                  .exchange()
                  .expectStatus().isEqualTo(HttpStatus.OK)
                  .expectBody();
      }
  
      private void deleteAndVerify(int id, HttpStatus httpStatus) {
           webTestClient.delete()
                  .uri("/movie-composite/" + id)
                  .exchange()
                  .expectStatus().isEqualTo(httpStatus);
      }
  
      private List&lt;ReviewSummary&gt; getReviewSummaries() {
          return Collections.singletonList(ReviewSummary.builder().reviewId(1).subject("s").author("a").content("c").build());
      }
  
      private List&lt;RecommendationSummary&gt; getRecommendationSummaries() {
          return Collections.singletonList(RecommendationSummary.builder().recommendationId(1).author("a").content("c").rate(1).build());
      }
  
      private Movie getMovies(int given) {
          return Movie.builder().movieId(given).address(FAKE_ADDRESS).genre(FAKE_GENRE).title(FAKE_TITLE).build();
      }
  
      private List&lt;Review&gt; getReviews(Movie movie) {
          return Arrays.asList(
                  Review.builder().movieId(movie.getMovieId()).reviewId(1).author("Author 1").subject("Subject 1").content("Content 1").serviceAddress(serviceUtil.getServiceAddress()).build(),
                  Review.builder().movieId(movie.getMovieId()).reviewId(2).author("Author 2").subject("Subject 2").content("Content 2").serviceAddress(serviceUtil.getServiceAddress()).build(),
                  Review.builder().movieId(movie.getMovieId()).reviewId(3).author("Author 2").subject("Subject 3").content("Content 3").serviceAddress(serviceUtil.getServiceAddress()).build()
          );
      }
  
      private List&lt;Recommendation&gt; getRecommendations(Movie movie) {
          return Arrays.asList(
                  Recommendation.builder().movieId(movie.getMovieId()).recommendationId(1).author("Author 1").rate(1).content("Content 1").serviceAddress(serviceUtil.getServiceAddress()).build(),
                  Recommendation.builder().movieId(movie.getMovieId()).recommendationId(2).author("Author 2").rate(2).content("Content 2").serviceAddress(serviceUtil.getServiceAddress()).build(),
                  Recommendation.builder().movieId(movie.getMovieId()).recommendationId(3).author("Author 3").rate(3).content("Content 3").serviceAddress(serviceUtil.getServiceAddress()).build()
          );
      }
  
  }
  </code></pre>
  
  <p>Why it won't pass where <strong>getMovieById()</strong> looks very similar when it comes to input and url and it passes?</p>