TemporaryFolder cannot be converted to java.io.File

Kind help please!
Am working on https://issues.openmrs.org/browse/TRUNK-5875 to ensure BaseContextSensitiveTest for JUnit 4 and JUnit5 properly clean-up a directory after running the unit tests. I have been using these links https://junit.org/junit5/docs/current/user-guide/#writing-tests-built-in-extensions-TempDirectory and https://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html#toAbsolutePath() as my reference but am running into one error after another and the latest error is this https://pastebin.com/TGaKf9Px of which I have run short of ideas on how to go about it. This is my PR https://github.com/openmrs/openmrs-core/pull/3491. Can someone help please on how to go about it?

@ibacher after appending .getAbsolutePath()); to OpenmrsUtil.setApplicationDataDirectory(testAppDataDir.getRoot()I still run into this error https://pastebin.com/cVRNtscP which am trying to fix.

Oh yes! I see! I focused on the first Travis error I saw. Just eliminate this line and the error will go away. JUnit should handle removing the directory for us.

1 Like

Thanks so much though not yet there https://pastebin.com/vEh2pZC2