From b100f55286bcf8a472dac944cb33c33594e6b815 Mon Sep 17 00:00:00 2001 From: Liao Xin <93535922+liewstar@users.noreply.github.com> Date: Thu, 1 Aug 2024 17:36:57 +0800 Subject: [PATCH] feat: update casbin jdbc and jcasbin dependencies (#104) --- build.gradle | 4 ++-- src/test/java/org/casbin/EnforcerTest.java | 1 + src/test/resources/application.yml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 5f42c3d..758dea0 100644 --- a/build.gradle +++ b/build.gradle @@ -39,12 +39,12 @@ dependencyManagement { } dependencies { - api 'org.casbin:jcasbin:1.40.0' + api 'org.casbin:jcasbin:1.55.0' compileOnly 'org.springframework.boot:spring-boot-starter-data-redis' compileOnly 'org.casbin:jcasbin-redis-watcher:1.4.1' runtimeOnly 'com.h2database:h2:2.2.224' implementation 'org.springframework.boot:spring-boot-starter-jdbc' - implementation('org.casbin:jdbc-adapter:2.5.0') { + implementation('org.casbin:jdbc-adapter:2.7.0') { exclude group: 'org.casbin', module: 'jcasbin' } implementation 'org.casbin:jcasbin-lettuce-redis-watcher:1.1.0' diff --git a/src/test/java/org/casbin/EnforcerTest.java b/src/test/java/org/casbin/EnforcerTest.java index 971bef0..42c0085 100644 --- a/src/test/java/org/casbin/EnforcerTest.java +++ b/src/test/java/org/casbin/EnforcerTest.java @@ -29,6 +29,7 @@ class EnforcerTest { @Test void test1() { + enforcer.clearPolicy(); // user rights enforcer.addPolicy("alice", "data1", "read"); enforcer.addPolicy("bob", "data2", "write"); diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index 1d40100..1eb0447 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -33,7 +33,7 @@ casbin: spring: # Although the data source is configured here, the custom data source is switched to H2 when the unit test is tested. datasource: - driver-class-name: com.mysql.jdbc.Driver + driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/casbin?useSSL=false username: root password: casbin_test