[Fix] Fixed WriteRolesFileHelperTest not being idempotent
This commit is contained in:
parent
538402e12a
commit
ef0a38db30
|
@ -1,7 +1,6 @@
|
|||
package li.strolch.privilege.test;
|
||||
|
||||
import static li.strolch.privilege.test.XmlTest.SRC_TEST;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -17,7 +16,8 @@ public class WriteRolesFileHelperTest {
|
|||
String src = SRC_TEST + "PrivilegeRoles.xml";
|
||||
String dst = "target/WriteRolesFileHelperTest_roles.xml";
|
||||
|
||||
assertFalse(new File(dst).exists());
|
||||
if (new File(dst).exists() && !new File(dst).delete())
|
||||
throw new IllegalStateException("Could not delete file " + dst);
|
||||
|
||||
WriteRolesFileHelper.main(new String[] { src, dst });
|
||||
|
||||
|
|
Loading…
Reference in New Issue