Skip to content

Commit 09733bb

Browse files
committed
Revert FrontendUnitTest.java to upstream version
1 parent 8cd163f commit 09733bb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/test/java/org/casbin/jcasbin/main/FrontendUnitTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@ public class FrontendUnitTest {
3232
public void testCasbinJsGetPermissionForUser() throws IOException {
3333
SyncedEnforcer e = new SyncedEnforcer("examples/rbac_model.conf", "examples/rbac_with_hierarchy_policy.csv");
3434
HashMap<String, Object> received = new Gson().fromJson(Frontend.casbinJsGetPermissionForUser(e, "alice"), HashMap.class);
35-
String receivedModelStr = ((String) received.get("m")).replace("\r\n", "\n").replace("\r", "\n");
36-
String expectedModelStr = new String(Files.readAllBytes(Paths.get("examples/rbac_model.conf"))).replace("\r\n", "\n").replace("\r", "\n");
37-
assertEquals(expectedModelStr, receivedModelStr);
35+
String expectedModelStr = new String(Files.readAllBytes(Paths.get("examples/rbac_model.conf")));
36+
assertEquals(received.get("m"), expectedModelStr);
3837

3938
String expectedPolicyStr = new String(Files.readAllBytes(Paths.get("examples/rbac_with_hierarchy_policy.csv")));
40-
expectedPolicyStr = expectedPolicyStr.replace("\r\n", "\n").replace("\r", "\n");
4139
expectedPolicyStr = Pattern.compile("\n+").matcher(expectedPolicyStr).replaceAll("\n");
4240
String[] expectedPolicyItem = expectedPolicyStr.split(",|\n");
4341
int i = 0;

0 commit comments

Comments
 (0)