@Test
public void testResolveArgumentThrowingServiceUnavailableException()
    throws MissingPathVariableException
{

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