@@ -81,24 +81,29 @@ public void setup() throws Exception {
8181 public void findAll () throws Exception {
8282
8383 context .turnOffAuthorisationSystem ();
84- MetadataField metadataField = MetadataFieldBuilder
85- .createMetadataField (context , "AnElement" , "AQualifier" , "AScopeNote" ).build ();
86- context .restoreAuthSystemState ();
8784
8885 getClient ().perform (get ("/api/core/metadatafields" )
89- .param ("size" , String .valueOf (100 )))
86+ .param ("size" , String .valueOf (9999 )))
9087 .andExpect (status ().isOk ())
9188 .andExpect (content ().contentType (contentType ))
9289 .andExpect (jsonPath ("$._embedded.metadatafields" , Matchers .hasItems (
9390 MetadataFieldMatcher .matchMetadataFieldByKeys ("dc" , "title" , null ),
9491 MetadataFieldMatcher .matchMetadataFieldByKeys ("dc" , "date" , "issued" ))
95- ))
92+ ));
93+ }
94+
95+ @ Test
96+ public void findAllPaginated () throws Exception {
97+ getClient ().perform (get ("/api/core/metadatafields" )
98+ .param ("size" , String .valueOf (2 )))
99+ .andExpect (status ().isOk ())
100+ .andExpect (content ().contentType (contentType ))
101+ .andExpect (jsonPath ("$._embedded.metadatafields" , Matchers .notNullValue ()))
96102 .andExpect (jsonPath ("$._links.first.href" , Matchers .containsString ("/api/core/metadatafields" )))
97103 .andExpect (jsonPath ("$._links.self.href" , Matchers .containsString ("/api/core/metadatafields" )))
98104 .andExpect (jsonPath ("$._links.next.href" , Matchers .containsString ("/api/core/metadatafields" )))
99105 .andExpect (jsonPath ("$._links.last.href" , Matchers .containsString ("/api/core/metadatafields" )))
100-
101- .andExpect (jsonPath ("$.page.size" , is (100 )));
106+ .andExpect (jsonPath ("$.page.size" , is (2 )));
102107 }
103108
104109 @ Test
0 commit comments