@Test public void isNotFoundNoHeaders() { final HttpClientErrorException exception = new HttpClientErrorException( HttpStatus.UNAUTHORIZED, "Unauthorized", null, null, StandardCharsets.UTF_8 ); Assert.assertFalse( RestTemplateUtils.isNotFound( exception ) ); }
public static boolean isNotFound( @Nonnull HttpClientErrorException e ) { if ( !HttpStatus.NOT_FOUND.equals( e.getStatusCode() ) ) { return false; } final HttpHeaders headers = e.getResponseHeaders(); return (headers != null) && MediaType.APPLICATION_JSON.isCompatibleWith( headers.getContentType() ); }
RestTemplateUtils { public static boolean isNotFound( @Nonnull HttpClientErrorException e ) { if ( !HttpStatus.NOT_FOUND.equals( e.getStatusCode() ) ) { return false; } final HttpHeaders headers = e.getResponseHeaders(); return (headers != null) && MediaType.APPLICATION_JSON.isCompatibleWith( headers.getContentType() ); } }
RestTemplateUtils { public static boolean isNotFound( @Nonnull HttpClientErrorException e ) { if ( !HttpStatus.NOT_FOUND.equals( e.getStatusCode() ) ) { return false; } final HttpHeaders headers = e.getResponseHeaders(); return (headers != null) && MediaType.APPLICATION_JSON.isCompatibleWith( headers.getContentType() ); } private  RestTemplateUtils(); }
RestTemplateUtils { public static boolean isNotFound( @Nonnull HttpClientErrorException e ) { if ( !HttpStatus.NOT_FOUND.equals( e.getStatusCode() ) ) { return false; } final HttpHeaders headers = e.getResponseHeaders(); return (headers != null) && MediaType.APPLICATION_JSON.isCompatibleWith( headers.getContentType() ); } private  RestTemplateUtils(); static boolean isNotFound( @Nonnull HttpClientErrorException e ); }
RestTemplateUtils { public static boolean isNotFound( @Nonnull HttpClientErrorException e ) { if ( !HttpStatus.NOT_FOUND.equals( e.getStatusCode() ) ) { return false; } final HttpHeaders headers = e.getResponseHeaders(); return (headers != null) && MediaType.APPLICATION_JSON.isCompatibleWith( headers.getContentType() ); } private  RestTemplateUtils(); static boolean isNotFound( @Nonnull HttpClientErrorException e );  }