Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RunWith(SpringJUnit4ClassRunner.class)
- @ContextConfiguration(locations = { .... })
- // order of test methods is important!
- @FixMethodOrder(MethodSorters.NAME_ASCENDING)
- public class MyTest {
- static {
- System.setProperty("myprop", "myvalue");
- }
- /**
- * Fake test that forces spring to reload context before real tests.
- */
- @Test
- @DirtiesContext
- public void aaReloadContext() {
- }
- /**
- * Fake test that clears system property after tests.
- */
- @Test
- public void zzClearProperty() {
- System.clearProperty("myprop");
- }
- ... real test methods...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement