// Save the real user.dir
String dir = System.getProperty("user.dir");
whitespace.mkdir();
System.setProperty("user.dir", whitespace.getCanonicalPath());
Build build = assertWhitespaceHandling(whitespace);
String warning1 = "[WARNING] THERE IS WHITESPACE IN CLASSPATH ELEMENT [%s]%n";
String warning2 = "Attempting relative path workaround%n";
assertEquals(format(warning1 + warning2 + warning1 + warning2,
build.getTestOutputDirectory(), build.getOutputDirectory()),
helper.logStream.toString());
// Restore the real user.dir (to prevent side-effects on other tests)
System.setProperty("user.dir", dir);
}