50
50
51
51
/**
52
52
* Integration tests for Jackson 2 HAL integration.
53
- *
53
+ *
54
54
* @author Alexander Baetz
55
55
* @author Oliver Gierke
56
56
* @author Greg Turnquist
@@ -70,7 +70,8 @@ public class Jackson2HalIntegrationTest extends AbstractJackson2MarshallingInteg
70
70
71
71
static final String ANNOTATED_PAGED_RESOURCES = "{\" _embedded\" :{\" pojos\" :[{\" text\" :\" test1\" ,\" number\" :1,\" _links\" :{\" self\" :{\" href\" :\" localhost\" }}},{\" text\" :\" test2\" ,\" number\" :2,\" _links\" :{\" self\" :{\" href\" :\" localhost\" }}}]},\" _links\" :{\" next\" :{\" href\" :\" foo\" },\" prev\" :{\" href\" :\" bar\" }},\" page\" :{\" size\" :2,\" totalElements\" :4,\" totalPages\" :2,\" number\" :0}}" ;
72
72
73
- static final Links PAGINATION_LINKS = Links .of (new Link ("foo" , IanaLinkRelations .NEXT .value ()), new Link ("bar" , IanaLinkRelations .PREV .value ()));
73
+ static final Links PAGINATION_LINKS = Links .of (new Link ("foo" , IanaLinkRelations .NEXT .value ()),
74
+ new Link ("bar" , IanaLinkRelations .PREV .value ()));
74
75
75
76
static final String CURIED_DOCUMENT = "{\" _links\" :{\" self\" :{\" href\" :\" foo\" },\" foo:myrel\" :{\" href\" :\" bar\" },\" curies\" :[{\" href\" :\" http://localhost:8080/rels/{rel}\" ,\" name\" :\" foo\" ,\" templated\" :true}]}}" ;
76
77
static final String MULTIPLE_CURIES_DOCUMENT = "{\" _links\" :{\" default:myrel\" :{\" href\" :\" foo\" },\" curies\" :[{\" href\" :\" bar\" ,\" name\" :\" foo\" },{\" href\" :\" foo\" ,\" name\" :\" bar\" }]}}" ;
@@ -123,18 +124,18 @@ public void rendersAllExtraRFC5988Attributes() throws Exception {
123
124
124
125
/**
125
126
* HAL doesn't support "media" so it's removed from the "expected" link.
126
- *
127
+ *
127
128
* @see #699
128
129
*/
129
130
@ Test
130
131
public void deserializeAllExtraRFC5988Attributes () throws Exception {
131
132
132
133
ResourceSupport expected = new ResourceSupport ();
133
134
expected .add (new Link ("localhost" , "self" ) //
134
- .withHreflang ("en" ) //
135
- .withTitle ("the title" ) //
136
- .withType ("the type" ) //
137
- .withDeprecation ("/customers/deprecated" ));
135
+ .withHreflang ("en" ) //
136
+ .withTitle ("the title" ) //
137
+ .withType ("the type" ) //
138
+ .withDeprecation ("/customers/deprecated" ));
138
139
139
140
assertThat (read (SINGLE_WITH_ALL_EXTRA_ATTRIBUTES , ResourceSupport .class )).isEqualTo (expected );
140
141
}
@@ -352,8 +353,7 @@ public void deserializesPagedResource() throws Exception {
352
353
@ Test
353
354
public void rendersCuriesCorrectly () throws Exception {
354
355
355
- Resources <Object > resources = new Resources <>(Collections .emptySet (), new Link ("foo" ),
356
- new Link ("bar" , "myrel" ));
356
+ Resources <Object > resources = new Resources <>(Collections .emptySet (), new Link ("foo" ), new Link ("bar" , "myrel" ));
357
357
358
358
assertThat (getCuriedObjectMapper ().writeValueAsString (resources )).isEqualTo (CURIED_DOCUMENT );
359
359
}
0 commit comments