Conversation
| * PUT /path -> 2xx (successful update/create with body B) | ||
| * GET /path -> 2xx (must return exactly the fields that were PUT) | ||
| * | ||
| * Returns true if any field sent in the PUT body has a different value |
There was a problem hiding this comment.
this is partial. you need also to check that GET is not returning fields not used in the PUT. or, if those are returned, if they are null
There was a problem hiding this comment.
also, need to check the differences in what declared in the schema, eg, the resource might have fields that are not supposed to be changed via a PUT (eg timestamps or ids)
| val putBody = extractRequestBody(put) | ||
| val getBody = resGet.getBody() | ||
|
|
||
| if (putBody.isNullOrEmpty() || getBody.isNullOrEmpty()) return false |
There was a problem hiding this comment.
if putBody is empty, but getBody is not, then we got a bug
There was a problem hiding this comment.
I also added this statement: if putBody is not empty, but getBody is. What do you think about that? Is that correct or lead to false positives?
There was a problem hiding this comment.
@omursahin hi, yes, should be fine, i guess shouldn't harm. but, anyway, those cases should still be handled when looking at fields one by one, isn't it?
There was a problem hiding this comment.
For this,
if (putBody.isNullOrEmpty() && !getBody.isNullOrEmpty()) return true
yes, you are right. I am updating it now.
But I guess we don't need to check fields for this statement:
if (!putBody.isNullOrEmpty() && getBody.isNullOrEmpty()) return true
Because if we send any value with put, we expect that it should be returned in the get body, right?
There was a problem hiding this comment.
yep, if send with PUT, we expect in GET.
|
|
||
| if (putBody.isNullOrEmpty() || getBody.isNullOrEmpty()) return false | ||
|
|
||
| val fieldNames = extractModifiedFieldNames(put) |
There was a problem hiding this comment.
here it should rather check the field names of what declared in the schema of the PUT. i have added some more discussion and examples to 2026/httporacles/notes.txt
| * Sequence checked: | ||
| * PUT /X body=B -> 2xx | ||
| * GET /X -> response body must match exactly B | ||
| * (no field from a previous state should bleed through) |
There was a problem hiding this comment.
see updated discussion at 2026/httporacles/notes.txt
| @Test | ||
| fun testRunEM() { | ||
|
|
||
| runTestHandlingFlakyAndCompilation( |
There was a problem hiding this comment.
not sure if best in a E2E or an integration test, but check to verify the example discussed in 2026/httporacles/notes.txt, especially making sure that K does not lead to flag a fault (ie false positive)
There was a problem hiding this comment.
I checked it in \core\src\test\kotlin\org\evomaster\core\problem\rest\oracle\HttpSemanticsOracleTest.kt but if you want, I can write an integration test too.
There was a problem hiding this comment.
as long as it checked, then it is fine :)
No description provided.