aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/resources/data
diff options
context:
space:
mode:
authorToine Siebelink <toine.siebelink@est.tech>2021-08-05 14:22:21 +0000
committerGerrit Code Review <gerrit@onap.org>2021-08-05 14:22:21 +0000
commit73be382a3558e2d6f1583cbb9bc7bd8d51be059b (patch)
treebce1335a4154eeff9c961c8e4b0295f5801b6ffc /src/test/resources/data
parent8169b24cac135fcaf731bb8014d0115362fda6d5 (diff)
parentc2b5e8523d874302d0f3c7f042d23bacf6d856a3 (diff)
Merge "Fetch data filtered by Search criteria"
Diffstat (limited to 'src/test/resources/data')
-rw-r--r--src/test/resources/data/network-data-changes.sql32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/test/resources/data/network-data-changes.sql b/src/test/resources/data/network-data-changes.sql
new file mode 100644
index 0000000..ce15f19
--- /dev/null
+++ b/src/test/resources/data/network-data-changes.sql
@@ -0,0 +1,32 @@
+--Clear the data before inserting
+DELETE FROM NETWORK_DATA WHERE DATASPACE in ( 'DATASPACE-01', 'DATASPACE-02');
+COMMIT;
+
+-- Test pagination data
+-- Test created Before filter
+-- Test observed After Filter
+INSERT INTO NETWORK_DATA (OBSERVED_TIMESTAMP, DATASPACE, ANCHOR, SCHEMA_SET, PAYLOAD, CREATED_TIMESTAMP)
+VALUES
+('2021-07-22 00:00:01.000', 'DATASPACE-01', 'ANCHOR-01', 'SCHEMA-SET-01', '{ "status" : "up" }'::jsonb, '2021-07-22 23:00:01.000'),
+('2021-07-22 01:00:01.000', 'DATASPACE-01', 'ANCHOR-01', 'SCHEMA-SET-01', '{ "status" : "down" }'::jsonb, '2021-07-22 23:00:01.000'),
+('2021-07-23 00:00:01.000', 'DATASPACE-01', 'ANCHOR-01', 'SCHEMA-SET-01', '{ "status" : "up" }'::jsonb, '2021-07-23 23:00:01.000');
+
+-- Test sorting on multiple fields
+INSERT INTO NETWORK_DATA (OBSERVED_TIMESTAMP, DATASPACE, ANCHOR, SCHEMA_SET, PAYLOAD, CREATED_TIMESTAMP)
+VALUES
+('2021-07-24 00:00:01.000', 'DATASPACE-01', 'ANCHOR-02', 'SCHEMA-SET-01', '{ "status" : "up" }'::jsonb, '2021-07-24 23:00:01.000');
+
+
+-- Test simple payload filter on multiple field
+INSERT INTO NETWORK_DATA (OBSERVED_TIMESTAMP, DATASPACE, ANCHOR, SCHEMA_SET, PAYLOAD, CREATED_TIMESTAMP)
+VALUES
+('2021-07-24 00:00:01.000', 'DATASPACE-02', 'ANCHOR-01', 'SCHEMA-SET-01', '{ "interfaces": [ { "id" : "01", "status" : "up" } ]}'::jsonb, '2021-07-24 01:00:01.000'),
+('2021-07-24 01:00:01.000', 'DATASPACE-02', 'ANCHOR-01', 'SCHEMA-SET-01', '{ "interfaces": [ { "id" : "01", "status" : "down" } ]}'::jsonb, '2021-07-24 02:00:01.000'),
+('2021-07-24 02:00:01.000', 'DATASPACE-02', 'ANCHOR-01', 'SCHEMA-SET-01', '{ "interfaces": [ { "id" : "02", "status" : "up" } ]}'::jsonb, '2021-07-24 03:00:01.000'),
+('2021-07-24 03:00:01.000', 'DATASPACE-02', 'ANCHOR-01', 'SCHEMA-SET-01', '{ "interfaces": [ { "id" : "03", "status" : "up" } ]}'::jsonb, '2021-07-24 04:00:01.000');
+
+COMMIT;
+
+
+
+