@@ -911,6 +911,47 @@ public void should_document_get_components_by_name() throws Exception {
911911 )));
912912 }
913913
914+ @ Test
915+ public void should_document_get_components_by_type_and_created_on () throws Exception {
916+ mockMvc .perform (get ("/api/components" )
917+ .header ("Authorization" , TestHelper .generateAuthHeader (testUserId , testUserPassword ))
918+ .queryParam ("componentType" , angularComponent .getComponentType ().toString ())
919+ .queryParam ("createdOn" , angularComponent .getCreatedOn ())
920+ .queryParam ("categories" , "javascript, sql" )
921+ .queryParam ("luceneSearch" , "false" )
922+ .queryParam ("page" , "0" )
923+ .queryParam ("page_entries" , "5" )
924+ .queryParam ("sort" , "name,desc" )
925+ .accept (MediaTypes .HAL_JSON ))
926+ .andExpect (status ().isOk ())
927+ .andDo (this .documentationHandler .document (
928+ queryParameters (
929+ parameterWithName ("componentType" ).description ("Filter for type" ),
930+ parameterWithName ("createdOn" ).description ("Filter for component creation date" ),
931+ parameterWithName ("categories" ).description ("Filter for categories" ),
932+ parameterWithName ("luceneSearch" ).description ("Filter with exact match or lucene match." ),
933+ parameterWithName ("page" ).description ("Page of components" ),
934+ parameterWithName ("page_entries" ).description ("Amount of components per page" ),
935+ parameterWithName ("sort" ).description ("Defines order of the components" )
936+ ),
937+ links (
938+ linkWithRel ("curies" ).description ("Curies are used for online documentation" ),
939+ linkWithRel ("first" ).description ("Link to first page" ),
940+ linkWithRel ("last" ).description ("Link to last page" )
941+ ),
942+ responseFields (
943+ subsectionWithPath ("_embedded.sw360:components.[]name" ).description ("The name of the component" ),
944+ subsectionWithPath ("_embedded.sw360:components.[]componentType" ).description ("The component type, possible values are: " + Arrays .asList (ComponentType .values ())),
945+ subsectionWithPath ("_embedded.sw360:components" ).description ("An array of <<resources-components, Components resources>>" ),
946+ subsectionWithPath ("_links" ).description ("<<resources-index-links,Links>> to other resources" ),
947+ fieldWithPath ("page" ).description ("Additional paging information" ),
948+ fieldWithPath ("page.size" ).description ("Number of components per page" ),
949+ fieldWithPath ("page.totalElements" ).description ("Total number of all existing components" ),
950+ fieldWithPath ("page.totalPages" ).description ("Total number of pages" ),
951+ fieldWithPath ("page.number" ).description ("Number of the current page" )
952+ )));
953+ }
954+
914955 @ Test
915956 public void should_document_update_component () throws Exception {
916957 ComponentDTO updateComponent = new ComponentDTO ();
0 commit comments