Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(subscription): expand watchedAttributes when updating a subscription #1039

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

bobeal
Copy link
Member

@bobeal bobeal commented Nov 6, 2023

No description provided.

@bobeal bobeal self-assigned this Nov 6, 2023
@github-actions github-actions bot added the fix Something isn't working label Nov 6, 2023
@bobeal bobeal added the subscription Relates to subscription API label Nov 6, 2023
Copy link
Contributor

github-actions bot commented Nov 6, 2023

Test Results

  54 files  ±0    54 suites  ±0   2m 33s ⏱️ + 1m 7s
857 tests ±0  856 ✔️  - 1  0 💤 ±0  1 +1 
896 runs  ±0  895 ✔️  - 1  0 💤 ±0  1 +1 

For more details on these failures, see this check.

Results for commit 5ca15fb. ± Comparison against base commit d43c28e.

This pull request removes 93 and adds 16 tests. Note that renamed tests count towards both.

               "2020-03-25T08:33:17.965206Z"
               "urn:ngsi-ld:Beekeeper:1234",
               20,
               25,
            "instanceId":"urn:ngsi-ld:Instance:45678",
            "instanceId":"urn:ngsi-ld:In…
            "observedAt":"2020-03-25T08:33:17.965206Z",
            "sub": "sub"
            "type":"Property",
…
com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [10] scopeHistory=[], attributeAndResultsMap={TemporalEntityAttribute(id=071d4a4f-1b22-4e5d-aa42-06a4c5c52977, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Property, attributeValueType=STRING, datasetId=null, createdAt=2023-11-06T08:22:14.242378757Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[SimplifiedAttributeInstanceResult(temporalEntityAttribute=a0459e08-3a1f-4f22-882a-b3b69ea07476, value=Beehive_incoming_123, time=2020-03-25T08:29:17.965206Z), SimplifiedAttributeInstanceRe…, withTemporalValues=true, withAudit=false, expectation={
  "id" : "urn:ngsi-ld:BeeHive:TESTC",
  "type" : "BeeHive",
  "incoming" : {
    "type" : "Property",
    "values" : [ ["Beehive_incoming_123","2020-03-25T08:29:17.965206Z"], ["Beehive_incoming_124","2020-03-25T08:33:17.965206Z"] ]
  }
}

com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [11] scopeHistory=[SimplifiedScopeInstanceResult(entityId=urn:ngsi-ld:BeeHive:TESTC, scopes=[/A/B, /C/D], time=2020-03-25T08:29:17.965206Z), SimplifiedScopeInstanceResult(entityId=urn:ngsi-ld:BeeHive:TESTC, scopes=[/C/D], time=2020-03-25T09:29:17.965206Z)], attributeAndResultsMap={}, withTemporalValues=true, withAudit=false, expectation={
  "id" : "urn:ngsi-ld:BeeHive:TESTC",
  "type" : "BeeHive",
  "scope" : {
    "type" : "Property",
    "values" : [ [["/A/B", "/C/D"],"2020-03-25T08:29:17.965206Z"], [["/C/D"],"2020-03-25T09:29:17.965206Z"] ]
  }
}

com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [12] scopeHistory=[FullScopeInstanceResult(entityId=urn:ngsi-ld:BeeHive:TESTC, scopes=[/A/B, /C/D], time=2020-03-25T08:29:17.965206Z, timeproperty=modifiedAt, sub=null), FullScopeInstanceResult(entityId=urn:ngsi-ld:BeeHive:TESTC, scopes=[/C/D], time=2020-03-25T09:29:17.965206Z, timeproperty=modifiedAt, sub=null)], attributeAndResultsMap={}, withTemporalValues=false, withAudit=false, expectation={
  "id" : "urn:ngsi-ld:BeeHive:TESTC",
  "type" : "BeeHive",
  "scope" : [{
    "type": "Property",
    "value": ["/A/B", "/C/D"],
    "modifiedAt": "2020-03-25T08:29:17.965206Z"
  }, {
    "type": "Property",
    "value": ["/C/D"],
    "modifiedAt": "2020-03-25T09:29:17.965206Z"
  }]
}

com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [1] entityTemporalResults=[EntityTemporalResult(entityPayload=EntityPayload(entityId=urn:ngsi-ld:BeeHive:TESTC, types=[https://ontology.eglobalmark.com/apic#BeeHive], scopes=null, createdAt=2023-11-06T08:22:14.111313266Z, modifiedAt=null, contexts=[https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/master/apic/jsonld-contexts/apic-compound.jsonld], payload=JsonByteArrayInput{{}}, specificAccessPolicy=null), scopeHistory=[], teaInstancesResult={TemporalEntityAttribute(id=06ac03d8-dd29-4e26-8478-cccebbd8f240,…, withTemporalValues=false, withAudit=true, expectation=[
   {
      "id":"urn:ngsi-ld:BeeHive:TESTC",
      "type":"BeeHive",
      "incoming":[
         {
            "type":"Property",
            "value":20,
            "instanceId":"urn:ngsi-ld:Instance:45678",
            "observedAt":"2020-03-25T08:33:17.965206Z",
            "sub": "sub"
         }
      ]
   },
   {
      "id":"urn:ngsi-ld:BeeHive:TESTD",
      "type":"BeeHive",
      "outgoing":[
         {
            "type":"Property",
            "value":25,
            "instanceId":"urn:ngsi-ld:In…
com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [1] scopeHistory=[], attributeAndResultsMap={TemporalEntityAttribute(id=9c14cdb2-9a89-42d9-8329-693ef82548e1, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Property, attributeValueType=NUMBER, datasetId=null, createdAt=2023-11-06T08:22:14.242378757Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[FullAttributeInstanceResult(temporalEntityAttribute=aff783c9-62da-4342-ba4c-7d97ab309a2b, payload={"type":"Property","instanceId":"urn:ngsi-ld:Instance:45678","observedAt":"2020-03-25T08:2…, withTemporalValues=false, withAudit=false, expectation={
  "id" : "urn:ngsi-ld:BeeHive:TESTC",
  "type" : "BeeHive",
  "incoming" : [ {
    "type" : "Property",
    "value" : 550.0,
    "instanceId" : "urn:ngsi-ld:Instance:45678",
    "observedAt" : "2020-03-25T08:29:17.965206Z"
  }, {
    "type" : "Property",
    "value" : 650.0,
    "instanceId" : "urn:ngsi-ld:Instance:45679",
    "observedAt" : "2020-03-25T08:33:17.965206Z"
  } ]
}

com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [2] entityTemporalResults=[EntityTemporalResult(entityPayload=EntityPayload(entityId=urn:ngsi-ld:BeeHive:TESTC, types=[https://ontology.eglobalmark.com/apic#BeeHive], scopes=null, createdAt=2023-11-06T08:22:14.111313266Z, modifiedAt=null, contexts=[https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/master/apic/jsonld-contexts/apic-compound.jsonld], payload=JsonByteArrayInput{{}}, specificAccessPolicy=null), scopeHistory=[], teaInstancesResult={TemporalEntityAttribute(id=47c32a34-414c-4fc8-818c-90b2864eefde,…, withTemporalValues=true, withAudit=false, expectation=[
   {
      "id":"urn:ngsi-ld:BeeHive:TESTC",
      "type":"BeeHive",
      "incoming": {
         "type":"Property",
         "values":[
            [
               20,
               "2020-03-25T08:33:17.965206Z"
            ]
         ]
      }
   },
   {
      "id":"urn:ngsi-ld:BeeHive:TESTD",
      "type":"BeeHive",
      "outgoing": {
         "type":"Property",
         "values":[
            [
               25,
               "2020-03-25T08:33:17.965206Z"
            ]
         ]
      }
   }
]

com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [2] scopeHistory=[], attributeAndResultsMap={TemporalEntityAttribute(id=34133dec-89f1-4eea-8b86-bb094088ed29, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Relationship, attributeValueType=STRING, datasetId=null, createdAt=2023-11-06T08:22:14.242378757Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[FullAttributeInstanceResult(temporalEntityAttribute=f91a153a-749f-4dfc-829e-44bef8fe20f2, payload={"type":"Relationship","instanceId":"urn:ngsi-ld:Instance:45678","observedAt":"2020-03…, withTemporalValues=false, withAudit=false, expectation={
  "id" : "urn:ngsi-ld:BeeHive:TESTC",
  "type" : "BeeHive",
  "incoming" : [ {
    "type" : "Relationship",
    "object" : "urn:ngsi-ld:Entity:1234",
    "instanceId" : "urn:ngsi-ld:Instance:45678",
    "observedAt" : "2020-03-25T08:29:17.965206Z"
  }, {
    "type" : "Relationship",
    "object" : "urn:ngsi-ld:Entity:5678",
    "instanceId" : "urn:ngsi-ld:Instance:45679",
    "observedAt" : "2020-03-25T08:33:17.965206Z"
  } ]
}

com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [3] entityTemporalResults=[EntityTemporalResult(entityPayload=EntityPayload(entityId=urn:ngsi-ld:BeeHive:TESTC, types=[https://ontology.eglobalmark.com/apic#BeeHive], scopes=null, createdAt=2023-11-06T08:22:14.111313266Z, modifiedAt=null, contexts=[https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/master/apic/jsonld-contexts/apic-compound.jsonld], payload=JsonByteArrayInput{{}}, specificAccessPolicy=null), scopeHistory=[], teaInstancesResult={TemporalEntityAttribute(id=b55c99b1-4006-43ec-83e8-66a1f01c5018,…, withTemporalValues=true, withAudit=false, expectation=[
   {
      "id":"urn:ngsi-ld:BeeHive:TESTC",
      "type":"BeeHive",
      "incoming": {
         "type":"Property",
         "values":[
            [
               20,
               "2020-03-25T08:33:17.965206Z"
            ]
         ]
      },
      "managedBy": {
         "type": "Relationship",
         "objects": [
            [
               "urn:ngsi-ld:Beekeeper:1234",
               "2020-03-25T08:33:17.965206Z"
            ]
         ]
      }
   },
   {
      "id":"urn:ngsi-ld:BeeHive:TEST…
com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [3] scopeHistory=[], attributeAndResultsMap={TemporalEntityAttribute(id=1fa98da3-ba5d-4c80-89ae-93d37ece8077, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Property, attributeValueType=NUMBER, datasetId=urn:ngsi-ld:Dataset:01234, createdAt=2023-11-06T08:22:14.242378757Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[FullAttributeInstanceResult(temporalEntityAttribute=376bf09c-51a5-41be-a64f-ad0e1ae56a37, payload={"type":"Property","datasetId":"urn:ngsi-ld:Dataset:01234","instanceI…, withTemporalValues=false, withAudit=false, expectation={
  "id" : "urn:ngsi-ld:BeeHive:TESTC",
  "type" : "BeeHive",
  "incoming" : [ {
    "type" : "Property",
    "datasetId" : "urn:ngsi-ld:Dataset:01234",
    "value" : 550.0,
    "instanceId" : "urn:ngsi-ld:Instance:01234",
    "observedAt" : "2020-03-25T08:29:17.965206Z"
  }, {
    "type" : "Property",
    "datasetId" : "urn:ngsi-ld:Dataset:01234",
    "value" : 650.0,
    "instanceId" : "urn:ngsi-ld:Instance:01235",
    "observedAt" : "2020-03-25T08:33:17.965206Z"
  }, {
    "type" : "Property",
    "data…
com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [4] scopeHistory=[], attributeAndResultsMap={TemporalEntityAttribute(id=601e4c9f-dda5-4405-9164-75de6f88d170, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Property, attributeValueType=STRING, datasetId=urn:ngsi-ld:Dataset:45678, createdAt=2023-11-06T08:22:14.242378757Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[FullAttributeInstanceResult(temporalEntityAttribute=5f5b6671-56d6-4ee4-9346-b7405d347379, payload={"type":"Property","datasetId":"urn:ngsi-ld:Dataset:45678","instanceI…, withTemporalValues=false, withAudit=false, expectation={
  "id" : "urn:ngsi-ld:BeeHive:TESTC",
  "type" : "BeeHive",
  "incoming" : [ {
    "type" : "Property",
    "datasetId" : "urn:ngsi-ld:Dataset:45678",
    "value" : "Beehive_incoming_123",
    "instanceId" : "urn:ngsi-ld:Instance:45678",
    "observedAt" : "2020-03-25T08:29:17.965206Z"
  }, {
    "type" : "Property",
    "datasetId" : "urn:ngsi-ld:Dataset:45678",
    "value" : "Beehive_incoming_124",
    "instanceId" : "urn:ngsi-ld:Instance:45679",
    "observedAt" : "2020-03-25T08:33:17.965206Z"
  } ]
}

…

@bobeal bobeal merged commit ddabfc4 into develop Nov 6, 2023
7 of 9 checks passed
@bobeal bobeal deleted the fix/expand-watched-attributes-when-updating-sub branch November 6, 2023 08:24
@github-actions github-actions bot locked and limited conversation to collaborators Nov 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fix Something isn't working subscription Relates to subscription API
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant