From: remillet Date: Tue, 16 Jan 2018 22:39:20 +0000 (-0800) Subject: DRYD-202: Added tests for new 'showItems' query param for /vocabularies/${id} GET... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=a0dceb765e6ee101dfd669c371dc4a92d335e258;p=tmp%2Fjakarta-migration.git DRYD-202: Added tests for new 'showItems' query param for /vocabularies/${id} GET requests. Added tests for paging as well since we get paging for free. --- diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/res/showVocab.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/res/showVocab.res.xml new file mode 100644 index 000000000..f6082f1e2 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/res/showVocab.res.xml @@ -0,0 +1,15 @@ + + + 3 + ShowItemsVocab + ${csid} + ShowItems Vocabulary + + This is a test vocabulary for the ShowItems XMLReplay test group. + + XML Replay ShowItems test group. + + urn:cspace:core.collectionspace.org:vocabularies:name(ShowItemsVocab)'ShowItems Vocabulary' + + + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/res/showVocabWithItems.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/res/showVocabWithItems.res.xml new file mode 100644 index 000000000..1425b8ecb --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/res/showVocabWithItems.res.xml @@ -0,0 +1,90 @@ + + + admin@core.collectionspace.org + admin@core.collectionspace.org + project + 1 + + urn:cspace:core.collectionspace.org:vocabularies:name(ShowItemsVocab)'ShowItems Vocabulary' + + /vocabularies/${csid} + + + 3 + ShowItemsVocab + ${csid} + ShowItems Vocabulary + + This is a test vocabulary for the ShowItems XMLReplay test group. + + XML Replay ShowItems test group. + + urn:cspace:core.collectionspace.org:vocabularies:name(ShowItemsVocab)'ShowItems Vocabulary' + + + + + fadf0bcf-7c34-40c3-b6e5-ab1988eba888 + Administrator + admin@core.collectionspace.org + 1 + + + + 0 + ${pgSz} + ${itemsInPage} + ${totalItems} + + csid|uri|refName|updatedAt|workflowState|rev|sas|proposed|deprecated|termStatus|order|displayName|shortIdentifier + + + ${createItem1} + + /vocabularies/${csid}/items/${createItem1} + + + urn:cspace:core.collectionspace.org:vocabularies:name(ShowItemsVocab):item:name(ShowItemsItem1)'ShowsItems item ShowItemsItem1' + + project + 0 + false + true + 1 + ShowsItems item ShowItemsItem1 + ShowItemsItem1 + + + ${createItem2} + + /vocabularies/${csid}/items/${createItem2} + + + urn:cspace:core.collectionspace.org:vocabularies:name(ShowItemsVocab):item:name(ShowItemsItem2)'ShowsItems item ShowItemsItem2' + + project + 0 + false + true + 2 + ShowsItems item ShowItemsItem2 + ShowItemsItem2 + + + ${createItem3} + + /vocabularies/${csid}/items/${createItem3} + + + urn:cspace:core.collectionspace.org:vocabularies:name(ShowItemsVocab):item:name(ShowItemsItem3)'ShowsItems item ShowItemsItem3' + + project + 0 + false + true + 3 + ShowsItems item ShowItemsItem3 + ShowItemsItem3 + + + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/res/showVocabWithItemsLastPage.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/res/showVocabWithItemsLastPage.res.xml new file mode 100644 index 000000000..cd1bbe837 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/res/showVocabWithItemsLastPage.res.xml @@ -0,0 +1,58 @@ + + + admin@core.collectionspace.org + admin@core.collectionspace.org + project + 1 + + urn:cspace:core.collectionspace.org:vocabularies:name(ShowItemsVocab)'ShowItems Vocabulary' + + /vocabularies/${csid} + + + 3 + ShowItemsVocab + ${csid} + ShowItems Vocabulary + + This is a test vocabulary for the ShowItems XMLReplay test group. + + XML Replay ShowItems test group. + + urn:cspace:core.collectionspace.org:vocabularies:name(ShowItemsVocab)'ShowItems Vocabulary' + + + + + fadf0bcf-7c34-40c3-b6e5-ab1988eba888 + Administrator + admin@core.collectionspace.org + 1 + + + + 0 + ${pgSz} + ${itemsInPage} + ${totalItems} + + csid|uri|refName|updatedAt|workflowState|rev|sas|proposed|deprecated|termStatus|order|displayName|shortIdentifier + + + ${createItem3} + + /vocabularies/${csid}/items/${createItem3} + + + urn:cspace:core.collectionspace.org:vocabularies:name(ShowItemsVocab):item:name(ShowItemsItem3)'ShowsItems item ShowItemsItem3' + + project + 0 + false + true + 3 + ShowsItems item ShowItemsItem3 + ShowItemsItem3 + + + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/res/showVocabWithItemsPaged.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/res/showVocabWithItemsPaged.res.xml new file mode 100644 index 000000000..1bfa26da2 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/res/showVocabWithItemsPaged.res.xml @@ -0,0 +1,74 @@ + + + admin@core.collectionspace.org + admin@core.collectionspace.org + project + 1 + + urn:cspace:core.collectionspace.org:vocabularies:name(ShowItemsVocab)'ShowItems Vocabulary' + + /vocabularies/${csid} + + + 3 + ShowItemsVocab + ${csid} + ShowItems Vocabulary + + This is a test vocabulary for the ShowItems XMLReplay test group. + + XML Replay ShowItems test group. + + urn:cspace:core.collectionspace.org:vocabularies:name(ShowItemsVocab)'ShowItems Vocabulary' + + + + + fadf0bcf-7c34-40c3-b6e5-ab1988eba888 + Administrator + admin@core.collectionspace.org + 1 + + + + 0 + ${pgSz} + ${itemsInPage} + ${totalItems} + + csid|uri|refName|updatedAt|workflowState|rev|sas|proposed|deprecated|termStatus|order|displayName|shortIdentifier + + + ${createItem1} + + /vocabularies/${csid}/items/${createItem1} + + + urn:cspace:core.collectionspace.org:vocabularies:name(ShowItemsVocab):item:name(ShowItemsItem1)'ShowsItems item ShowItemsItem1' + + project + 0 + false + true + 1 + ShowsItems item ShowItemsItem1 + ShowItemsItem1 + + + ${createItem2} + + /vocabularies/${csid}/items/${createItem2} + + + urn:cspace:core.collectionspace.org:vocabularies:name(ShowItemsVocab):item:name(ShowItemsItem2)'ShowsItems item ShowItemsItem2' + + project + 0 + false + true + 2 + ShowsItems item ShowItemsItem2 + ShowItemsItem2 + + + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/showItems-item-template.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/showItems-item-template.xml new file mode 100644 index 000000000..2d61b5003 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/showItems-item-template.xml @@ -0,0 +1,14 @@ + + + + ${displayName} + ${itemID} + urn:cspace:org.collectionspace.demo:vocabulary:name(TestOrderVocab):item:name(${itemID})'${displayName}' + ${order} + This is a test vocabulary item + Some mythical book + The page should match the order:${order} + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/showItems-vocab.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/showItems-vocab.xml new file mode 100644 index 000000000..b8a9e811c --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ShowItems/showItems-vocab.xml @@ -0,0 +1,11 @@ + + + + ShowItems Vocabulary + ShowItemsVocab + This is a test vocabulary for the ShowItems XMLReplay test group. + XML Replay ShowItems test group. + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/vocabulary.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/vocabulary.xml index 64aa09f3e..92924270f 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/vocabulary.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/vocabulary.xml @@ -5,7 +5,112 @@ YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y - + + + + + POST + /cspace-services/vocabularies/ + vocabulary/ShowItems/showItems-vocab.xml + + + POST + /cspace-services/vocabularies/${createShowItemsVocab.CSID}/items/ + vocabulary/ShowItems/showItems-item-template.xml + + ShowItemsItem1 + 1 + ShowsItems item ${itemID} + + + + POST + /cspace-services/vocabularies/${createShowItemsVocab.CSID}/items/ + vocabulary/ShowItems/showItems-item-template.xml + + ShowItemsItem2 + 2 + ShowsItems item ${itemID} + + + + POST + /cspace-services/vocabularies/${createShowItemsVocab.CSID}/items/ + vocabulary/ShowItems/showItems-item-template.xml + + ShowItemsItem3 + 3 + ShowsItems item ${itemID} + + + + GET + /cspace-services/vocabularies/${createShowItemsVocab.CSID} + + + ${createShowItemsVocab.CSID} + + + + vocabulary/ShowItems/res/showVocab.res.xml + + + + GET + /cspace-services/vocabularies/${createShowItemsVocab.CSID}?showItems=true + + + 2500 + 3 + 3 + ${createShowItemsVocab.CSID} + ${createItem1.CSID} + ${createItem2.CSID} + ${createItem3.CSID} + + + vocabulary/ShowItems/res/showVocabWithItems.res.xml + + + + GET + /cspace-services/vocabularies/${createShowItemsVocab.CSID}?showItems=true&pgSz=2 + + + 2 + 2 + 3 + ${createShowItemsVocab.CSID} + ${createItem1.CSID} + ${createItem2.CSID} + ${createItem3.CSID} + + + vocabulary/ShowItems/res/showVocabWithItemsPaged.res.xml + + + + GET + /cspace-services/vocabularies/${createShowItemsVocab.CSID}?showItems=true&pgSz=2&pgNum=1 + + + 2 + 1 + 3 + ${createShowItemsVocab.CSID} + ${createItem1.CSID} + ${createItem2.CSID} + ${createItem3.CSID} + + + vocabulary/ShowItems/res/showVocabWithLastPage.res.xml + + + + +