File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
main/java/org/springframework/restdocs/hypermedia
test/java/org/springframework/restdocs/hypermedia Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2014-2019 the original author or authors.
2+ * Copyright 2014-2025 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -38,7 +38,6 @@ class ContentTypeLinkExtractor implements LinkExtractor {
3838
3939 ContentTypeLinkExtractor () {
4040 this .linkExtractors .put (MediaType .APPLICATION_JSON , new AtomLinkExtractor ());
41-
4241 LinkExtractor halLinkExtractor = new HalLinkExtractor ();
4342 this .linkExtractors .put (HalLinkExtractor .HAL_MEDIA_TYPE , halLinkExtractor );
4443 this .linkExtractors .put (HalLinkExtractor .VND_HAL_MEDIA_TYPE , halLinkExtractor );
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2014-2016 the original author or authors.
2+ * Copyright 2014-2025 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
3030 * format.
3131 *
3232 * @author Andy Wilkinson
33+ * @author Oliver Drotbohm
3334 */
3435class HalLinkExtractor extends AbstractJsonLinkExtractor {
3536
3637 static final MediaType HAL_MEDIA_TYPE = new MediaType ("application" , "hal+json" );
38+
3739 static final MediaType VND_HAL_MEDIA_TYPE = new MediaType ("application" , "vnd.hal+json" );
40+
3841 static final MediaType HAL_FORMS_MEDIA_TYPE = new MediaType ("application" , "prs.hal-forms+json" );
3942
4043 @ Override
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ void extractorCalledWithCompatibleContextType() throws IOException {
7676 }
7777
7878 @ Test
79- public void extractsLinksFromVndHalMediaType () throws IOException {
79+ void extractsLinksFromVndHalMediaType () throws IOException {
8080 HttpHeaders httpHeaders = new HttpHeaders ();
8181 httpHeaders .setContentType (MediaType .parseMediaType ("application/vnd.hal+json" ));
8282 OperationResponse response = this .responseFactory .create (HttpStatus .OK , httpHeaders , this .halBody .getBytes ());
@@ -85,7 +85,7 @@ public void extractsLinksFromVndHalMediaType() throws IOException {
8585 }
8686
8787 @ Test
88- public void extractsLinksFromHalFormsMediaType () throws IOException {
88+ void extractsLinksFromHalFormsMediaType () throws IOException {
8989 HttpHeaders httpHeaders = new HttpHeaders ();
9090 httpHeaders .setContentType (MediaType .parseMediaType ("application/prs.hal-forms+json" ));
9191 OperationResponse response = this .responseFactory .create (HttpStatus .OK , httpHeaders , this .halBody .getBytes ());
You can’t perform that action at this time.
0 commit comments