@Test
public void testResolveArgumentThrowingRepositoryNotFoundException()
    throws MissingPathVariableException
{

    Map<String, String> uriTemplateVars = new HashMap<>();
    uriTemplateVars.put("storageId", "storage-pypi");
    uriTemplateVars.put("repositoryId", "maven-releases");
    nativeWebRequest.setAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE, uriTemplateVars,
                                  RequestAttributes.SCOPE_REQUEST);
    mockStoragesAndRepositories(RepositoryStatusEnum.IN_SERVICE);
    // RepositoryNotFoundException Test Case
    MethodParameter uploadArtifactWithOutOfServiceRepositoryNotAllowedMethod = getMethodParameter("uploadArtifactWithOutOfServiceRepositoryNotAllowed",
                                                                                                  Repository.class);
    RepositoryNotFoundException repositoryNotFoundException = Assertions.assertThrows(RepositoryNotFoundException.class,
                                                                                      () -> repositoryMethodArgumentResolver.resolveArgument(uploadArtifactWithOutOfServiceRepositoryNotAllowedMethod,
                                                                                                                                             modelAndViewContainer,
                                                                                                                                             nativeWebRequest,
                                                                                                                                             webDataBinderFactory));
    assertEquals(String.format(RepositoryMethodArgumentResolver.NOT_FOUND_REPOSITORY_MESSAGE,
                               uriTemplateVars.get("storageId"), uriTemplateVars.get("repositoryId")),
                 repositoryNotFoundException.getMessage());
    mockStoragesAndRepositories(RepositoryStatusEnum.OUT_OF_SERVICE);
    repositoryNotFoundException = Assertions.assertThrows(RepositoryNotFoundException.class,
                                                          () -> repositoryMethodArgumentResolver.resolveArgument(uploadArtifactWithOutOfServiceRepositoryNotAllowedMethod,
                                                                                                                 modelAndViewContainer,
                                                                                                                 nativeWebRequest,
                                                                                                                 webDataBinderFactory));
    assertEquals(String.format(RepositoryMethodArgumentResolver.NOT_FOUND_REPOSITORY_MESSAGE,
                               uriTemplateVars.get("storageId"), uriTemplateVars.get("repositoryId")),
                 repositoryNotFoundException.getMessage());
}