### Question:
ManifestPusher implements RegistryEndpointProvider<DescriptorDigest> { @Override public DescriptorDigest handleHttpResponseException(ResponseException responseException) throws ResponseException, RegistryErrorException { if (responseException.getStatusCode() != HttpStatus.SC_BAD_REQUEST && responseException.getStatusCode() != HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE) { throw responseException; } ErrorCodes errorCode = ErrorResponseUtil.getErrorCode(responseException); if (errorCode == ErrorCodes.MANIFEST_INVALID || errorCode == ErrorCodes.TAG_INVALID) { throw new RegistryErrorExceptionBuilder(getActionDescription(), responseException) .addReason( "Registry may not support pushing OCI Manifest or " + "Docker Image Manifest Version 2, Schema 2") .build(); } throw responseException; } ManifestPusher(
      RegistryEndpointRequestProperties registryEndpointRequestProperties,
      ManifestTemplate manifestTemplate,
      String imageTag,
      EventHandlers eventHandlers); @Override BlobHttpContent getContent(); @Override List<String> getAccept(); @Override DescriptorDigest handleHttpResponseException(ResponseException responseException); @Override DescriptorDigest handleResponse(Response response); @Override URL getApiRoute(String apiRouteBase); @Override String getHttpMethod(); @Override String getActionDescription();  }### Answer:
@Test public void testHandleHttpResponseException_otherError() throws RegistryErrorException { ResponseException exception = Mockito.mock(ResponseException.class); Mockito.when(exception.getStatusCode()).thenReturn(HttpStatus.SC_UNAUTHORIZED); try { testManifestPusher.handleHttpResponseException(exception); Assert.fail(); } catch (ResponseException ex) { Assert.assertSame(exception, ex); } }