@Test
public void testResolveArgumentThrowingStorageNotFoundException()
    throws MissingPathVariableException
{

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