Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageyml
titleSample OpenAPI yAML
collapsetrue
executeSearchForMatchingPublicProperties:
  post:
    description: Execute search to get all cm handles for the given public properties
    tags:
      - network-cm-proxy
    summary: Execute cm handle search using
    operationId: executeSearchForMatchingPublicProperties
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: 'components.yaml#/components/schemas/PublicProperties'
    responses:
      200:
        description: OK
        content:
          application/json:
            schema:
              type: array
              items:
                type: string
      400:
        $ref: 'components.yaml#/components/responses/BadRequest'
      401:
        $ref: 'components.yaml#/components/responses/Unauthorized'
      403:
        $ref: 'components.yaml#/components/responses/Forbidden'
      404:
        $ref: 'components.yaml#/components/responses/NotFound'
      500:
        $ref: 'components.yaml#/components/responses/InternalServerError'


Testing

Edge Cases

  • Null name, Value
  • Empty name, Value
  • no key value pairs at all 

Manual Testing

...


Data


Code Block
languagesql
titleinsert sql
collapsetrue
INSERT INTO public.fragment (xpath, "attributes") VALUES('/dmi-registry/cm-handles[@id=''PNFDemo'']/public-properties[@name=''Contact'']', '{"name": "Contact", "value": "newemailforstore@bookstore.com"}');
INSERT INTO public.fragment (xpath, "attributes") VALUES('/dmi-registry/cm-handles[@id=''Bookstore4'']/public-properties[@name=''color'']', '{"name": "color", "value": ""}');
INSERT INTO public.fragment (xpath, "attributes") VALUES('/dmi-registry/cm-handles[@id=''Bookstore3'']/public-properties[@name=''color'']', '{"name": "color", "value": "red"}');
INSERT INTO public.fragment (xpath, "attributes") VALUES('/dmi-registry/cm-handles[@id=''Bookstore2'']/public-properties[@name=''Contact'']', '{"name": "Contact", "value": "newemailforstore2@bookstore.com"}');
INSERT INTO public.fragment (xpath, "attributes") VALUES('/dmi-registry/cm-handles[@id=''Bookstore1'']/public-properties[@name=''Contact'']', '{"name": "Contact", "value": "newemailforstore@bookstore.com"}');


URL

http://localhost:8883/ncmp/v1/data/ch/searches


Results

Happy Path

#ScenarioRequestResponse
1

Both properties match

(Return CM Handles Returned that Match

{
    "publicCmHandleProperties": {
        "Contact""newemailforstore@bookstore.com"
    }
}

[
    "Bookstore1",
    "PNFDemo"
]

2

No properties given - all cm handles returned

(that contain public properties

{

    "publicCmHandleProperties": {
    }
}

[
    "Bookstore4",
    "Bookstore1",
    "Bookstore2",
    "Bookstore3",
    "PNFDemo"
]


Edge Cases

#ScenarioRequestResponse
1

Value doesn't match 

(Nothing Returned

{
    "publicCmHandleProperties": {
        "Contact""notAValidValue"
    }
}

[ ]
2

Unknown properties given - NO cm handles returned

(Return Empty Response)

{
    "publicCmHandleProperties": {
        "UnknwnProperty""doesnt matter"
    }
}

[ ]
3

Empty property name

Return 400

(BAD_REQUEST)

{

    "publicCmHandleProperties": {
        """doesnt matter "
    }
}

{
    "status""400 BAD_REQUEST",
    "message""Invalid data",
    "details""Missing property - please supply a valid property"
}

4

Empty value 

(Return CM Handles Returned that Match

{

    "publicCmHandleProperties": {
        "color"""
    }
}

[
    "Bookstore4"
]

...