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 1
1
/*
2
- * Copyright 2014-2019 the original author or authors.
2
+ * Copyright 2014-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -38,7 +38,6 @@ class ContentTypeLinkExtractor implements LinkExtractor {
38
38
39
39
ContentTypeLinkExtractor () {
40
40
this .linkExtractors .put (MediaType .APPLICATION_JSON , new AtomLinkExtractor ());
41
-
42
41
LinkExtractor halLinkExtractor = new HalLinkExtractor ();
43
42
this .linkExtractors .put (HalLinkExtractor .HAL_MEDIA_TYPE , halLinkExtractor );
44
43
this .linkExtractors .put (HalLinkExtractor .VND_HAL_MEDIA_TYPE , halLinkExtractor );
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2014-2016 the original author or authors.
2
+ * Copyright 2014-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
30
30
* format.
31
31
*
32
32
* @author Andy Wilkinson
33
+ * @author Oliver Drotbohm
33
34
*/
34
35
class HalLinkExtractor extends AbstractJsonLinkExtractor {
35
36
36
37
static final MediaType HAL_MEDIA_TYPE = new MediaType ("application" , "hal+json" );
38
+
37
39
static final MediaType VND_HAL_MEDIA_TYPE = new MediaType ("application" , "vnd.hal+json" );
40
+
38
41
static final MediaType HAL_FORMS_MEDIA_TYPE = new MediaType ("application" , "prs.hal-forms+json" );
39
42
40
43
@ Override
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ void extractorCalledWithCompatibleContextType() throws IOException {
76
76
}
77
77
78
78
@ Test
79
- public void extractsLinksFromVndHalMediaType () throws IOException {
79
+ void extractsLinksFromVndHalMediaType () throws IOException {
80
80
HttpHeaders httpHeaders = new HttpHeaders ();
81
81
httpHeaders .setContentType (MediaType .parseMediaType ("application/vnd.hal+json" ));
82
82
OperationResponse response = this .responseFactory .create (HttpStatus .OK , httpHeaders , this .halBody .getBytes ());
@@ -85,7 +85,7 @@ public void extractsLinksFromVndHalMediaType() throws IOException {
85
85
}
86
86
87
87
@ Test
88
- public void extractsLinksFromHalFormsMediaType () throws IOException {
88
+ void extractsLinksFromHalFormsMediaType () throws IOException {
89
89
HttpHeaders httpHeaders = new HttpHeaders ();
90
90
httpHeaders .setContentType (MediaType .parseMediaType ("application/prs.hal-forms+json" ));
91
91
OperationResponse response = this .responseFactory .create (HttpStatus .OK , httpHeaders , this .halBody .getBytes ());
You can’t perform that action at this time.
0 commit comments