Join GitHub today
@ExpectedDatabase value attribute input two or more requests #64
@philwebb I have resolved to write @ExpectedDatabases like the following code to set the override attribute to a false @ExpectedDatabase.
Thank you @philwebb
Hello, I think I ran into the same issue that @bluepoet encountered and worked around using override=false:
I found that @ExpectedDatabase is @repeatable, but in a test that should fail it depended on the order of the annotations on the method:
The test method is actually empty, so the expectation is that the annotation with expect_ParentSpring_updated.xml fails the test, since no update happens.
But if I change the order of the @ExpectedDatabase annotations, the test succeeds:
By checking the code I found that verification stops if one annotation has the override flag set to true, which is the default for @ExpectedDatabase, see
In this case, the last annotation is evaluated first and, since override==true, stops further verification.
I think the concept needs refinement or this behavior should be documented.
Workaround is, like @bluepoet wrote, to set override=false on the annotations after the the first (or all, if no class level annotation has been done).
@ExpectedDatabases annotation doesn't help since it shows the same issue.