diff --git a/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java b/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java index 0ba298e..a4b69c1 100644 --- a/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java +++ b/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java @@ -37,6 +37,11 @@ public class TestRules { "FullTextIndexNode-search", "geoanalytics-main-service-UNKNOWN", "GeoNetwork-login", + "GRSFPublisher-create", + "GRSFPublisher-delete", + "GRSFPublisher-getURLandIdFromName", + "GRSFPublisher-UNKNOWN", + "GRSFPublisher-update", "RConnector-connect", "RConnector-UNKNOWN", "ShareLatex-connect", @@ -96,7 +101,7 @@ public class TestRules { @Test public void testSingleRule() throws Exception { - testRule("storage-UNKNOWN"); + testRule("GRSFPublisher-update"); } } diff --git a/src/test/resources/rules/GRSFPublisher-UNKNOWN.csv b/src/test/resources/rules/GRSFPublisher-UNKNOWN.csv new file mode 100644 index 0000000..0792c5b --- /dev/null +++ b/src/test/resources/rules/GRSFPublisher-UNKNOWN.csv @@ -0,0 +1,3 @@ +Data-Catalogue,GRSFPublisher,UNKNOWN +Data-Catalogue,GRSFPublisher,/rest/firms/hello +Data-Catalogue,GRSFPublisher,/rest/ram/hello diff --git a/src/test/resources/rules/GRSFPublisher-UNKNOWN.json b/src/test/resources/rules/GRSFPublisher-UNKNOWN.json new file mode 100644 index 0000000..05e756f --- /dev/null +++ b/src/test/resources/rules/GRSFPublisher-UNKNOWN.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "Data-Catalogue", + "serviceNameRegex": "GRSFPublisher", + "calledMethodRegex": ".*(hello)|(UNKNOWN).*" + }, + "replace": { + "serviceClass": "Data-Catalogue", + "serviceName": "GRSFPublisher", + "calledMethod": "UNKNOWN" + } +} \ No newline at end of file diff --git a/src/test/resources/rules/GRSFPublisher-create.csv b/src/test/resources/rules/GRSFPublisher-create.csv new file mode 100644 index 0000000..d2436dd --- /dev/null +++ b/src/test/resources/rules/GRSFPublisher-create.csv @@ -0,0 +1,14 @@ +Data-Catalogue,GRSFPublisher,/rest/firms/fishery/publish-product +Data-Catalogue,GRSFPublisher,/rest/firms/stock/publish-product +Data-Catalogue,GRSFPublisher,/rest/fishsource/fishery/publish-product +Data-Catalogue,GRSFPublisher,/rest/grsf/fishery/publish-product +Data-Catalogue,GRSFPublisher,rest/firms/stock/publish-product +Data-Catalogue,GRSFPublisher,rest/grsf/stock/publish-product +Data-Catalogue,GRSFPublisher,rest/ram/stock/publish-product +Data-Catalogue,GRSFPublisher,rest/grsf/fishery/publish-product +Data-Catalogue,GRSFPublisher,/rest/fishsource/stock/publish-product +Data-Catalogue,GRSFPublisher,/rest/grsf/stock/publish-product +Data-Catalogue,GRSFPublisher,/rest/ram/stock/publish-product +Data-Catalogue,GRSFPublisher,rest/firms/fishery/publish-product +Data-Catalogue,GRSFPublisher,rest/fishsource/fishery/publish-product +Data-Catalogue,GRSFPublisher,rest/fishsource/stock/publish-product diff --git a/src/test/resources/rules/GRSFPublisher-create.json b/src/test/resources/rules/GRSFPublisher-create.json new file mode 100644 index 0000000..8981a14 --- /dev/null +++ b/src/test/resources/rules/GRSFPublisher-create.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "Data-Catalogue", + "serviceNameRegex": "GRSFPublisher", + "calledMethodRegex": ".*publish-product.*" + }, + "replace": { + "serviceClass": "Data-Catalogue", + "serviceName": "GRSFPublisher", + "calledMethod": "create" + } +} \ No newline at end of file diff --git a/src/test/resources/rules/GRSFPublisher-delete.csv b/src/test/resources/rules/GRSFPublisher-delete.csv new file mode 100644 index 0000000..a0dc233 --- /dev/null +++ b/src/test/resources/rules/GRSFPublisher-delete.csv @@ -0,0 +1,5 @@ +Data-Catalogue,GRSFPublisher,/rest/firms/fishery/delete-product +Data-Catalogue,GRSFPublisher,/rest/firms/stock/delete-product +Data-Catalogue,GRSFPublisher,/rest/grsf/fishery/delete-product +Data-Catalogue,GRSFPublisher,/rest/grsf/stock/delete-product +Data-Catalogue,GRSFPublisher,rest/firms/stock/delete-product diff --git a/src/test/resources/rules/GRSFPublisher-delete.json b/src/test/resources/rules/GRSFPublisher-delete.json new file mode 100644 index 0000000..4bae3d0 --- /dev/null +++ b/src/test/resources/rules/GRSFPublisher-delete.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "Data-Catalogue", + "serviceNameRegex": "GRSFPublisher", + "calledMethodRegex": ".*delete-product.*" + }, + "replace": { + "serviceClass": "Data-Catalogue", + "serviceName": "GRSFPublisher", + "calledMethod": "delete" + } +} \ No newline at end of file diff --git a/src/test/resources/rules/GRSFPublisher-getURLandIdFromName.csv b/src/test/resources/rules/GRSFPublisher-getURLandIdFromName.csv new file mode 100644 index 0000000..5e06c62 --- /dev/null +++ b/src/test/resources/rules/GRSFPublisher-getURLandIdFromName.csv @@ -0,0 +1,13 @@ +Data-Catalogue,GRSFPublisher,/rest/fishsource/fishery/get-catalogue-id-and-url-from-name +Data-Catalogue,GRSFPublisher,/rest/fishsource/stock/get-catalogue-id-and-url-from-name +Data-Catalogue,GRSFPublisher,/rest/grsf/fishery/get-catalogue-id-and-url-from-name +Data-Catalogue,GRSFPublisher,/rest/grsf/stock/get-catalogue-id-and-url-from-name +Data-Catalogue,GRSFPublisher,rest/firms/fishery/get-catalogue-id-and-url-from-name +Data-Catalogue,GRSFPublisher,rest/firms/stock/get-catalogue-id-and-url-from-name +Data-Catalogue,GRSFPublisher,rest/fishsource/fishery/get-catalogue-id-and-url-from-name +Data-Catalogue,GRSFPublisher,rest/fishsource/stock/get-catalogue-id-and-url-from-name +Data-Catalogue,GRSFPublisher,rest/grsf/fishery/get-catalogue-id-and-url-from-name +Data-Catalogue,GRSFPublisher,rest/grsf/stock/get-catalogue-id-and-url-from-name +Data-Catalogue,GRSFPublisher,rest/ram/fishery/get-catalogue-id-and-url-from-name +Data-Catalogue,GRSFPublisher,rest/ram/stock/get-catalogue-id-and-url-from-name +Data-Catalogue,GRSFPublisher,rest/ram/stock/get-catalogue-id-from-name diff --git a/src/test/resources/rules/GRSFPublisher-getURLandIdFromName.json b/src/test/resources/rules/GRSFPublisher-getURLandIdFromName.json new file mode 100644 index 0000000..488fffb --- /dev/null +++ b/src/test/resources/rules/GRSFPublisher-getURLandIdFromName.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "Data-Catalogue", + "serviceNameRegex": "GRSFPublisher", + "calledMethodRegex": ".*get-catalogue-id-(and-url-){0,1}from-name.*" + }, + "replace": { + "serviceClass": "Data-Catalogue", + "serviceName": "GRSFPublisher", + "calledMethod": "getURLandIdFromName" + } +} \ No newline at end of file diff --git a/src/test/resources/rules/GRSFPublisher-update.csv b/src/test/resources/rules/GRSFPublisher-update.csv new file mode 100644 index 0000000..52be001 --- /dev/null +++ b/src/test/resources/rules/GRSFPublisher-update.csv @@ -0,0 +1 @@ +Data-Catalogue,GRSFPublisher,/rest/grsf/stock/update-product diff --git a/src/test/resources/rules/GRSFPublisher-update.json b/src/test/resources/rules/GRSFPublisher-update.json new file mode 100644 index 0000000..6563c83 --- /dev/null +++ b/src/test/resources/rules/GRSFPublisher-update.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "Data-Catalogue", + "serviceNameRegex": "GRSFPublisher", + "calledMethodRegex": ".*update-product.*" + }, + "replace": { + "serviceClass": "Data-Catalogue", + "serviceName": "GRSFPublisher", + "calledMethod": "update" + } +} \ No newline at end of file