Skip to content

FEATURE - Mock Stream properties #760

@junwei-tj

Description

@junwei-tj

As a UI5 developer
I want to mock Stream properties of my dataset,
so that I can test my UI5 app is able to process them correctly

Description

What is the high level purpose and value of the feature? The description should ensure that anyone reading understands what it is doing (at a high level) and most importantly why.

Suppose we have the following metadata definition:

<EntityType Name="InspectionResults">
    ...
    <Property Name="image" Type="Edm.Stream" />`
    ...
</EntityType>
...
<Annotations Target="InspectionResults.InspectionResults/image">
                <Annotation Term="Core.Computed" Bool="false" />
                <Annotation Term="Core.MediaType" Path="mediaType" />
                <Annotation Term="Core.AcceptableMediaTypes">
                    <Collection>
                        <String>image/png</String>
                        <String>image/jpeg</String>
                    </Collection>
                </Annotation>
            </Annotations>

When we get the InspectionResults/image attribute, the image's binary data would be returned as response. Then, the frontend can display the image straightaway.

Sample response:
image
image

Sample query: curl --location 'localhost:8080/odata/v4/VisualInspectionResult.svc/InspectionResults(46cc8aa3-5e6e-447d-b571-b01e4612cbcf)/image'

Technical Design

What modules need to be created or enhanced?
How would the functionality be exposed and how can it be consumed?

Acceptance Criteria

GivenWhenThen format (https://martinfowler.com/bliki/GivenWhenThen.html)

Given I have a ...
when I execute ...
then ... will happen.

Notes

Tasks

  • Unit Tests added
  • Test Cases defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions