Hi all,
I did find and try the following from google search: - wrap all the tests in a class - tag the class with @RunWith(SpringRunner.class) - tag every method that manipulates the entity data with @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) This has NOT been successful, hence a strong indication that running the cases in Groovy will make entity data manipulations to be sticky and not reverted for the subsequent test case run. I am going to rework my cases to run as JUnit test cases in a Java class. Warm regards Carsten > Am 03.09.2020 um 13:13 schrieb Carsten Schinzer > <cars...@dcs-verkaufssysteme.de>: > > Hi everyone, > > > Recently, I did find that test cases actually are much easier to write in > Groovy and hence I started doing that, but now I stumble across the fact that > some of the Groovy tests seem to find changes applied to entities from > previous tests. The behavior is the following: > > - I load the test data with instructions given in the tested XML > - I manipulate data in the first test data, e.g. a status on an entity > - when I run the next test case I do not get the originally loaded entity but > the manipulated one from the previous test > > This is different from JUnit in Java where the entities seem to exist as > loaded from the testdata XML with every new test case. > It would obviously mean that I we need to implement my testing in JUnit > (Java) rather when we want extensive testing of the services and need to > start from the loaded data every time. > > Can anyone confirm this behavior of Groovy over JUnit? > Warm regards > > > Carsten >