From e1f5a86d0dfd5c5f83c691f11366a2074a25b053 Mon Sep 17 00:00:00 2001 From: Noureddine Date: Tue, 9 Jun 2026 23:14:26 +0100 Subject: [PATCH 1/5] Update cron schedule in testing workflow --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 5b9f0fffc8..796d25ac31 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: pull_request: schedule: - - cron: '0 13 * * *' + - cron: '13 * * * *' concurrency: group: ci-${{ github.repository }} From 88487826a2c3f7b3ce4d289e9f6f099425c477a5 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 17:49:17 +0000 Subject: [PATCH 2/5] Add generation timestamp to registrar metadata Co-authored-by: noursaidi <9341216+noursaidi@users.noreply.github.com> --- gencode/java/udmi/schema/Metadata.java | 10 +++++++++- schema/metadata.json | 6 ++++++ .../com/google/daq/mqtt/registrar/LocalDevice.java | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gencode/java/udmi/schema/Metadata.java b/gencode/java/udmi/schema/Metadata.java index 9650067e71..f48eefad78 100644 --- a/gencode/java/udmi/schema/Metadata.java +++ b/gencode/java/udmi/schema/Metadata.java @@ -42,6 +42,13 @@ public class Metadata { @JsonProperty("upgraded_from") @JsonPropertyDescription("Original version of the UDMI schema for this file") public java.lang.String upgraded_from; + /** + * RFC 3339 timestamp UTC the registrar started + * + */ + @JsonProperty("generation") + @JsonPropertyDescription("RFC 3339 timestamp UTC the registrar started") + public Date generation; /** * DEPRECATED * @@ -171,6 +178,7 @@ public class Metadata { @Override public int hashCode() { int result = 1; + result = ((result* 31)+((this.generation == null)? 0 :this.generation.hashCode())); result = ((result* 31)+((this.alarmset == null)? 0 :this.alarmset.hashCode())); result = ((result* 31)+((this.testing == null)? 0 :this.testing.hashCode())); result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); @@ -201,7 +209,7 @@ public boolean equals(java.lang.Object other) { return false; } Metadata rhs = ((Metadata) other); - return (((((((((((((((((((this.alarmset == rhs.alarmset)||((this.alarmset!= null)&&this.alarmset.equals(rhs.alarmset)))&&((this.testing == rhs.testing)||((this.testing!= null)&&this.testing.equals(rhs.testing))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.structure == rhs.structure)||((this.structure!= null)&&this.structure.equals(rhs.structure))))&&((this.cloud == rhs.cloud)||((this.cloud!= null)&&this.cloud.equals(rhs.cloud))))&&((this.relationships == rhs.relationships)||((this.relationships!= null)&&this.relationships.equals(rhs.relationships))))&&((this.features == rhs.features)||((this.features!= null)&&this.features.equals(rhs.features))))&&((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system))))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery))))&&((this.upgraded_from == rhs.upgraded_from)||((this.upgraded_from!= null)&&this.upgraded_from.equals(rhs.upgraded_from))))&&((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset))))&&((this.externals == rhs.externals)||((this.externals!= null)&&this.externals.equals(rhs.externals))))&&((this.operation == rhs.operation)||((this.operation!= null)&&this.operation.equals(rhs.operation))))&&((this.hash == rhs.hash)||((this.hash!= null)&&this.hash.equals(rhs.hash))))&&((this.gateway == rhs.gateway)||((this.gateway!= null)&&this.gateway.equals(rhs.gateway))))&&((this.localnet == rhs.localnet)||((this.localnet!= null)&&this.localnet.equals(rhs.localnet))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.policy == rhs.policy)||((this.policy!= null)&&this.policy.equals(rhs.policy)))); + return ((((((((((((((((((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.alarmset == rhs.alarmset)||((this.alarmset!= null)&&this.alarmset.equals(rhs.alarmset))))&&((this.testing == rhs.testing)||((this.testing!= null)&&this.testing.equals(rhs.testing))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.structure == rhs.structure)||((this.structure!= null)&&this.structure.equals(rhs.structure))))&&((this.cloud == rhs.cloud)||((this.cloud!= null)&&this.cloud.equals(rhs.cloud))))&&((this.relationships == rhs.relationships)||((this.relationships!= null)&&this.relationships.equals(rhs.relationships))))&&((this.features == rhs.features)||((this.features!= null)&&this.features.equals(rhs.features))))&&((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system))))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery))))&&((this.upgraded_from == rhs.upgraded_from)||((this.upgraded_from!= null)&&this.upgraded_from.equals(rhs.upgraded_from))))&&((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset))))&&((this.externals == rhs.externals)||((this.externals!= null)&&this.externals.equals(rhs.externals))))&&((this.operation == rhs.operation)||((this.operation!= null)&&this.operation.equals(rhs.operation))))&&((this.hash == rhs.hash)||((this.hash!= null)&&this.hash.equals(rhs.hash))))&&((this.gateway == rhs.gateway)||((this.gateway!= null)&&this.gateway.equals(rhs.gateway))))&&((this.localnet == rhs.localnet)||((this.localnet!= null)&&this.localnet.equals(rhs.localnet))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.policy == rhs.policy)||((this.policy!= null)&&this.policy.equals(rhs.policy)))); } } diff --git a/schema/metadata.json b/schema/metadata.json index 4cba2901ec..9fc23fdaf9 100644 --- a/schema/metadata.json +++ b/schema/metadata.json @@ -26,6 +26,12 @@ "description": "Original version of the UDMI schema for this file", "type": "string" }, + "generation": { + "description": "RFC 3339 timestamp UTC the registrar started", + "type": "string", + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] + }, "hash": { "description": "DEPRECATED", "type": "string", diff --git a/validator/src/main/java/com/google/daq/mqtt/registrar/LocalDevice.java b/validator/src/main/java/com/google/daq/mqtt/registrar/LocalDevice.java index 215cb0887b..5abb153c9a 100644 --- a/validator/src/main/java/com/google/daq/mqtt/registrar/LocalDevice.java +++ b/validator/src/main/java/com/google/daq/mqtt/registrar/LocalDevice.java @@ -231,6 +231,7 @@ class LocalDevice implements SiteDevice { public void initialize() { prepareOutDir(); populatePointUrls(); + ifNotNullThen(metadata, m -> m.generation = JsonUtil.getDate(generation)); ifTrueThen(deviceKind == DeviceKind.LOCAL && metadata != null, this::validateMetadata); configure(); } From 86c03b6fa6e9a66b5693f330fe61dc1dd7104f6c Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 17:59:55 +0000 Subject: [PATCH 3/5] Add generation timestamp to registrar and update schema artifacts - Added 'generation' field to metadata.json schema. - Regenerated Java and Python schema classes using bin/gencode. - Updated Registrar to populate the generation timestamp in device metadata. - Added a test case in RegistrarTest to verify propagation to the cloud. Co-authored-by: noursaidi <9341216+noursaidi@users.noreply.github.com> --- .gencode_hash.txt | 6 +-- gencode/docs/metadata.html | 38 +++++++++++++++++++ gencode/python/udmi/schema/metadata.py | 1 + .../daq/mqtt/registrar/RegistrarTest.java | 12 ++++++ 4 files changed, 54 insertions(+), 3 deletions(-) diff --git a/.gencode_hash.txt b/.gencode_hash.txt index 882dc6d141..b7502bc4c3 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -15,7 +15,7 @@ eafcc3c48189f605f114cde051fea9d13fc5f1a3e395d64fb0a91cb53d4c9aeb gencode/docs/e 81043ba732caab75704d38e6977b32b1c2bcdad89d94ad2a259d0e70ca4aa40e gencode/docs/events_system.html 46fd37b577c655965346d1e3ececf559c4384791214900eeeea1ad8fc72a02b8 gencode/docs/events_udmi.html baf59590b1a71a49e59d8f499ae5112a1b7a555294dbd72bc821203aecceefa3 gencode/docs/events_validation.html -d41d92237c191cc32c4b734201f221a07ac44db528f99524a91cbe23571bfdd5 gencode/docs/metadata.html +bf60f5a343a57de94d74326dfb9204c73918cb1afcd394a12966565fcd1c042a gencode/docs/metadata.html 9277115c2937b52954c565fd2701cdd03e74ec2cb16b6567490770b8df2753f3 gencode/docs/monitoring.html 6f332da9cc64230df3551f9748a4eaa4060146e767cae967fc0e73b1f348be5b gencode/docs/persistent_device.html e11595fd11477947a27461f8ef4fb6facb5f60e2abd6212193f7581ab123ff84 gencode/docs/properties.html @@ -106,7 +106,7 @@ fc2e671ab0c4b15ff0ea3f7db417d969bd5af8e86c00b8acef4f2e9d34fea1d2 gencode/java/u ce36448574f7e3ae85523b6cdc580c43668667ab96f9dcfdfb3bf3075bebb806 gencode/java/udmi/schema/MappingEvents.java 41a49d92e0b66a84c7ae4cecd665d9c088350cac83b0a14483619f5c467ec638 gencode/java/udmi/schema/MappingState.java faab64907b7d5a7ee6aeb8f6f2926274b8bf7a732e27ca28b1bffa64ca44c93d gencode/java/udmi/schema/MessageTemplateData.java -8dde7cc44b13ef463eea2bafc7cbbe17cb60e6f305cedb0a166a21608f6f2796 gencode/java/udmi/schema/Metadata.java +65f839bb27a28cc44e96573dbe6793822408fdfad86f1b7b4cef62ba4d5eba9d gencode/java/udmi/schema/Metadata.java e4e967da341ca824c7688b31c440b27d2247ab8e74abfefd584c28bfc99441f2 gencode/java/udmi/schema/Metrics.java 189c32fc3b4b4d5a6f011b3ef8c7119278a19fbe490b5327c029ca471cfebed6 gencode/java/udmi/schema/Monitoring.java a43b73cbf5baadc6cd054f26aa97be58d3738a046acbba7c2ccedc2a21a1d7ac gencode/java/udmi/schema/MonitoringMetric.java @@ -219,7 +219,7 @@ e4cdab07942e52cae243b4dddbc72676794914947dd66df8add0f5969f31fd11 gencode/python 72559779680c79dace3c5903022709852cbad7b77ed42af97debc8d852d61cb7 gencode/python/udmi/schema/events_validation.py a3ea178f98a4993da708e2ec41f5ede74aa92d742ffbe201a77adef803d4143a gencode/python/udmi/schema/events_validation_device.py 5660433b409bdaeacdce6b128660914586cca434e5373b3f94c04e89952642b4 gencode/python/udmi/schema/level.py -9577d11c5110af169aafd0e083d115c849ce17dfdc2b6b23b7186c69c1c333db gencode/python/udmi/schema/metadata.py +cba94e8281d42450fc7590d738a3061f43a53ba8d81acef1edfaebdd0ee4d9e2 gencode/python/udmi/schema/metadata.py cd81df64d7db21ab06f84cdbd07a808a641612c7c1124f9f2d928a898c3c767e gencode/python/udmi/schema/model_alarmset.py b80b7f580fd7527da0c2caff063218488cf5bbd091daa64a6a5f9a5d45b135c2 gencode/python/udmi/schema/model_alarmset_alarm.py 6d19eb94063acbc8e5432b9827e8b20f4f8cd02efa6ae760fabe60652c69542d gencode/python/udmi/schema/model_cloud.py diff --git a/gencode/docs/metadata.html b/gencode/docs/metadata.html index 4a396bc55b..c319081b89 100644 --- a/gencode/docs/metadata.html +++ b/gencode/docs/metadata.html @@ -131,6 +131,44 @@

+ + + + +
+
+
+

+ +

+
+ +
+
+ + Type: stringFormat: date-time
+

RFC 3339 timestamp UTC the registrar started

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
diff --git a/gencode/python/udmi/schema/metadata.py b/gencode/python/udmi/schema/metadata.py index 1f8ac5e28a..a10619989f 100644 --- a/gencode/python/udmi/schema/metadata.py +++ b/gencode/python/udmi/schema/metadata.py @@ -32,6 +32,7 @@ class Metadata(DataModel): timestamp: Optional[str] = None version: Optional[str] = None upgraded_from: Optional[str] = None + generation: Optional[str] = None hash: Optional[str] = None operation: Optional[Operation] = None cloud: Optional[CloudModel] = None diff --git a/validator/src/test/java/com/google/daq/mqtt/registrar/RegistrarTest.java b/validator/src/test/java/com/google/daq/mqtt/registrar/RegistrarTest.java index 826ebb516e..e46626a8b4 100644 --- a/validator/src/test/java/com/google/daq/mqtt/registrar/RegistrarTest.java +++ b/validator/src/test/java/com/google/daq/mqtt/registrar/RegistrarTest.java @@ -195,6 +195,18 @@ public void transitiveUpdate() { assertEquals("Transitive devices", 3, transitiveCreates); } + @Test + public void generationTimestamp() { + List mockActions = executeRegistrarPopulated(ImmutableList.of()); + List updateActions = filterActions(mockActions, UPDATE_DEVICE_ACTION); + updateActions.forEach(action -> { + CloudModel model = (CloudModel) action.data; + String udmiMetadata = model.metadata.get("udmi_metadata"); + Metadata metadata = com.google.udmi.util.JsonUtil.fromString(Metadata.class, udmiMetadata); + assertTrue("metadata generation timestamp", metadata.generation != null); + }); + } + @Test public void basicUpdates() { List mockActions = executeRegistrarPopulated(ImmutableList.of()); From db07558b6f2009dbe1003faa8a26ff3a971801e5 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 19:06:49 +0000 Subject: [PATCH 4/5] Add generation timestamp to registrar and update schema artifacts - Added 'generation' field to metadata.json schema. - Regenerated Java and Python schema classes using bin/gencode. - Updated Registrar to populate the generation timestamp in device metadata. - Added a test case in RegistrarTest to verify propagation to the cloud. - Updated bin/test_sites to be resilient to the new generation field and schema property list changes. Co-authored-by: noursaidi <9341216+noursaidi@users.noreply.github.com> --- bin/test_sites | 3 ++- tests/sites/downgrade/devices/DWN-2/expected/errors.map | 2 +- tests/sites/downgrade/devices/DWN-4/expected/errors.map | 2 +- tests/sites/subsystem/devices/DEV-1/expected/errors.map | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/test_sites b/bin/test_sites index dfd77e40ea..9a68ca600a 100755 --- a/bin/test_sites +++ b/bin/test_sites @@ -38,6 +38,7 @@ function redact_files { -e 's-.*tests/sites/configs/- REDACTED/sites/configs/-' \ -e 's-^ File not found: /app/tests/sites/- REDACTED/sites/-' \ -e 's-^ File not found: .*udmi/tests/- REDACTED/-' \ + -e 's/([0-9]+ known properties: )("[^"]*"|, | )+/\1REDACTED/g' \ $file done } @@ -74,7 +75,7 @@ for subset in $subsets; do for device in $devices; do devicesout=$devicesdir/$device/out if [[ -d $devicesout ]]; then - find $devicesout -name \*.json | xargs -i bash -c "jq -e . {} >/dev/null 2>&1 && jq . {} | sponge {} || true" + find $devicesout -name \*.json | xargs -i bash -c "jq -e . {} >/dev/null 2>&1 && jq 'del(.generation)' {} | sponge {} || true" redact_files $devicesout/* $site_dir/registration_summary.json diffs=$(diff -rq $devicesout $devicesdir/$device/expected 2>&1) || true if [[ -n $diffs ]]; then diff --git a/tests/sites/downgrade/devices/DWN-2/expected/errors.map b/tests/sites/downgrade/devices/DWN-2/expected/errors.map index 68bc22beff..53c18c142c 100644 --- a/tests/sites/downgrade/devices/DWN-2/expected/errors.map +++ b/tests/sites/downgrade/devices/DWN-2/expected/errors.map @@ -2,4 +2,4 @@ Exceptions for DWN-2 While loading device metadata for DWN-2 While converting strict to udmi.schema.Metadata While converting string/string to udmi.schema.Metadata - Unrecognized field "grumpy" (class udmi.schema.Metadata), not marked as ignorable (18 known properties: "upgraded_from", "gateway", "operation", "externals", "hash", "system", "discovery", "alarmset", "localnet", "structure", "cloud", "timestamp", "version", "relationships", "features", "testing", "pointset", "policy"]) at [Source: (String)"{ "cloud" : { "auth_type" : "RS256" }, "grumpy" : { "reason" : "This is an intentional schema violation to test the tools" }, "hash" : "da852d15", "localnet" : { "families" : { "vendor" : { "addr" : "0x65" } } }, "pointset" : { "exclude_units_from_config" : true, "points" : { "filter_alarm_pressure_status" : { "ref" : "BV11.present_value", "units" : "No-units" }, "filter_differential_pressure" : { "[truncated 667 chars]; line: 5, column: 15] (through reference chain: udmi.schema.Metadata["grumpy"]) + Unrecognized field "grumpy" (class udmi.schema.Metadata), not marked as ignorable (19 known properties: REDACTED]) at [Source: (String)"{ "cloud" : { "auth_type" : "RS256" }, "grumpy" : { "reason" : "This is an intentional schema violation to test the tools" }, "hash" : "da852d15", "localnet" : { "families" : { "vendor" : { "addr" : "0x65" } } }, "pointset" : { "exclude_units_from_config" : true, "points" : { "filter_alarm_pressure_status" : { "ref" : "BV11.present_value", "units" : "No-units" }, "filter_differential_pressure" : { "[truncated 667 chars]; line: 5, column: 15] (through reference chain: udmi.schema.Metadata["grumpy"]) diff --git a/tests/sites/downgrade/devices/DWN-4/expected/errors.map b/tests/sites/downgrade/devices/DWN-4/expected/errors.map index 5beb50e7b5..a7de3ce20b 100644 --- a/tests/sites/downgrade/devices/DWN-4/expected/errors.map +++ b/tests/sites/downgrade/devices/DWN-4/expected/errors.map @@ -2,4 +2,4 @@ Exceptions for DWN-4 While loading device metadata for DWN-4 While converting strict to udmi.schema.Metadata While converting string/string to udmi.schema.Metadata - Unrecognized field "subsystem" (class udmi.schema.LocalnetModel), not marked as ignorable (3 known properties: "families", "networks", "parent"]) at [Source: (String)"{ "cloud" : { "auth_type" : "RS256" }, "hash" : "da852d15", "localnet" : { "subsystem" : { "vendor" : { "id" : "0x65" } } }, "pointset" : { "exclude_units_from_config" : true, "points" : { "filter_alarm_pressure_status" : { "ref" : "BV11.present_value", "units" : "No-units" }, "filter_differential_pressure" : { "units" : "Bars" }, "filter_differential_pressure_sensor" : { "ref" : "AV"[truncated 471 chars]; line: 7, column: 20] (through reference chain: udmi.schema.Metadata["localnet"]->udmi.schema.LocalnetModel["subsystem"]) + Unrecognized field "subsystem" (class udmi.schema.LocalnetModel), not marked as ignorable (3 known properties: REDACTED]) at [Source: (String)"{ "cloud" : { "auth_type" : "RS256" }, "hash" : "da852d15", "localnet" : { "subsystem" : { "vendor" : { "id" : "0x65" } } }, "pointset" : { "exclude_units_from_config" : true, "points" : { "filter_alarm_pressure_status" : { "ref" : "BV11.present_value", "units" : "No-units" }, "filter_differential_pressure" : { "units" : "Bars" }, "filter_differential_pressure_sensor" : { "ref" : "AV"[truncated 471 chars]; line: 7, column: 20] (through reference chain: udmi.schema.Metadata["localnet"]->udmi.schema.LocalnetModel["subsystem"]) diff --git a/tests/sites/subsystem/devices/DEV-1/expected/errors.map b/tests/sites/subsystem/devices/DEV-1/expected/errors.map index 3a0e868db3..f360148d96 100644 --- a/tests/sites/subsystem/devices/DEV-1/expected/errors.map +++ b/tests/sites/subsystem/devices/DEV-1/expected/errors.map @@ -2,4 +2,4 @@ Exceptions for DEV-1 While loading device metadata for DEV-1 While converting strict to udmi.schema.Metadata While converting string/string to udmi.schema.Metadata - Unrecognized field "network_id" (class udmi.schema.FamilyLocalnetModel), not marked as ignorable (7 known properties: "parent_id", "addr", "family", "shadow_id", "vendor_ref", "network", "adjunct"]) at [Source: (String)"{ "gateway" : { "gateway_id" : "GW-1", "target" : { "family" : "modbus", "network_id" : "modbus_1" } }, "localnet" : { "families" : { "modbus" : { "addr" : "1" } } }, "system" : { "hardware" : { "make" : "BOS", "model" : "device" }, "software" : { "firmware" : "v1" } }, "timestamp" : "2020-05-01T13:39:07Z", "version" : "1.5.2" }"; line: 6, column: 23] (through reference chain: udmi.schema.Metadata["gateway"]->udmi.schema.GatewayModel["target"]->udmi.schema.FamilyLocalnetModel["network_id"]) + Unrecognized field "network_id" (class udmi.schema.FamilyLocalnetModel), not marked as ignorable (7 known properties: REDACTED]) at [Source: (String)"{ "gateway" : { "gateway_id" : "GW-1", "target" : { "family" : "modbus", "network_id" : "modbus_1" } }, "localnet" : { "families" : { "modbus" : { "addr" : "1" } } }, "system" : { "hardware" : { "make" : "BOS", "model" : "device" }, "software" : { "firmware" : "v1" } }, "timestamp" : "2020-05-01T13:39:07Z", "version" : "1.5.2" }"; line: 6, column: 23] (through reference chain: udmi.schema.Metadata["gateway"]->udmi.schema.GatewayModel["target"]->udmi.schema.FamilyLocalnetModel["network_id"]) From 05d770ed44f56fc64971bb7470cb8fa9f772205f Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 20:09:16 +0000 Subject: [PATCH 5/5] Add generation timestamp to registrar metadata and ensure test stability - Added 'generation' field to metadata.json schema. - Regenerated Java and Python schema classes using bin/gencode. - Updated Registrar to populate the generation timestamp in device metadata. - Added test cases in RegistrarTest and LocalDeviceTest to verify logic. - Updated bin/test_sites to be resilient to the new generation field and schema property list changes. - Updated expected error maps to match the new redacted format. Co-authored-by: noursaidi <9341216+noursaidi@users.noreply.github.com> --- .../google/daq/mqtt/registrar/LocalDeviceTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/validator/src/test/java/com/google/daq/mqtt/registrar/LocalDeviceTest.java b/validator/src/test/java/com/google/daq/mqtt/registrar/LocalDeviceTest.java index c97014a227..69c335894f 100644 --- a/validator/src/test/java/com/google/daq/mqtt/registrar/LocalDeviceTest.java +++ b/validator/src/test/java/com/google/daq/mqtt/registrar/LocalDeviceTest.java @@ -47,6 +47,17 @@ public void getMergedMetadata() { assertNull("raw cloud detail is defined", catchToNull(() -> rawMetadata.cloud.detail)); } + @Test + public void generationSet() { + String testGeneration = JsonUtil.isoConvert(); + SiteModel siteModel = new SiteModel(EMPTY_DEFAULTS_SITE); + LocalDevice localDevice = new LocalDevice(siteModel, DEVICE_ID, SCHEMAS, testGeneration, + DeviceKind.SIMPLE); + localDevice.initialize(); + assertEquals("metadata generation set", testGeneration, + JsonUtil.isoConvert(localDevice.getMetadata().generation)); + } + private LocalDevice getTestInstance(String sitePath) { SiteModel siteModel = new SiteModel(sitePath); assertTrue("test device exists: " + DEVICE_ID, siteModel.deviceExists(DEVICE_ID));