@Test public void isNotFoundTrue() { final HttpHeaders headers = new HttpHeaders(); headers.set( HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_UTF8_VALUE ); final HttpClientErrorException exception = new HttpClientErrorException( HttpStatus.NOT_FOUND, "Not Found", headers, null, StandardCharsets.UTF_8 ); Assert.assertTrue( 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 );  }