* To migrate your tests follow <a href="https://wiki.openmrs.org/display/docs/How+to+migrate+to+JUnit+5">How to migrate to JUnit 5</a>.
* The JUnit 5 version of the class is {@link org.openmrs.test.jupiter.BaseContextSensitiveTest}.<p>
*/
-@ContextConfiguration(locations = { "classpath:applicationContext-service.xml", "classpath*:openmrs-servlet.xml",
- "classpath*:moduleApplicationContext.xml", "classpath*:TestingApplicationContext.xml" })
-@TestExecutionListeners( { TransactionalTestExecutionListener.class, SkipBaseSetupAnnotationExecutionListener.class,
- StartModuleExecutionListener.class })
+@ContextConfiguration(locations = {"classpath:applicationContext-service.xml", "classpath*:openmrs-servlet.xml",
+ "classpath*:moduleApplicationContext.xml", "classpath*:TestingApplicationContext.xml"})
+@TestExecutionListeners({TransactionalTestExecutionListener.class, SkipBaseSetupAnnotationExecutionListener.class,
+ StartModuleExecutionListener.class})
@Transactional
@Rollback
@Deprecated
runtimeProperties.setProperty(ModuleConstants.IGNORE_CORE_MODULES_PROPERTY, "true");
try {
- File tempappdir = File.createTempFile("appdir-for-unit-tests-", "");
- tempappdir.delete(); // so we can make it into a directory
- tempappdir.mkdir(); // turn it into a directory
+ File tempappdir = Files.createTempDirectory("appdir-for-unit-tests-" + "").toFile(); // turn it into a directory
tempappdir.deleteOnExit(); // clean up when we're done with tests
runtimeProperties.setProperty(OpenmrsConstants.APPLICATION_DATA_DIRECTORY_RUNTIME_PROPERTY, tempappdir
Problem
Example diff
Recipes in example diff:
References:
3rH9m