Closed texttechne closed 8 months ago
If this is a bound action you need to create an executeAction
method on the dedicated entityset file.
So in your case you need a SomethingEntitities.js with executeAction
inside
Hi @nlunets, indeed it works the way you describe. Thanks!
However, this is quite surprising: It is a V2 service, so it's not a bound action but an unbound function (V2 only knows unbound functions via FunctionImport
).
The EntitySet
attribute I'm talking about is added when the ReturnType
is a proper EntityType. When returning primitive types or complex types, then this attribute is not set.
This means, that the mock server differentiates between bound & unbound operations for V2 based on the return type, while in reality there exist no unbound operations for V2.
That's true indeed... Changing this however would be a breaking change on the mockserver implementation that i'd like to avoid :)
The fact that you are on the correct entityset used for the return type seems also to be a good thing for me somehow.
Changing this however would be a breaking change on the mockserver implementation that i'd like to avoid :)
Yeah, agreed.
But I would strongly recommend to update the documentation in this regard as it is unexpected behaviour.
Documentation is now updated !
Description
Let's start with a compliment. The mock server is a wonderful piece of software, so thanks for your awesome work!
I'm successfully using the MockServer or more specifically the EntityContainerApi for mocking
FunctionImports
(fileEntityContainer.js
exporting methodexecuteAction
).However, when the metadata specifies the
EntitySet
attribute theexecuteAction
method is not called at all. Example:Am I missing something here? Do I need to mock the function somewhere else? Then again, I don't understand why...
Expected results
Mock function
executeAction
gets called regardless whether the attributeEntitySet
is set or not.Actual results
I don't know how to mock such functions.
Version/Components/Environment
Add any other context about the problem here OS: Windows OData version: V2
Root Cause Analysis
Problem
{describe the problem}
Fix
{describe the fix}
Why was it missed
{Some explanation why this issue might have been missed during normal development/testing cycle}
How can we avoid this
{if we don’t want to see this type of issues anymore what we should do to prevent}