[Fix] Fixed WriteRolesFileHelperTest not being idempotent

This commit is contained in:
Robert von Burg 2022-11-21 12:11:34 +01:00
parent 538402e12a
commit ef0a38db30
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 2 additions and 2 deletions

View File

@ -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 });