Skip to content

Commit

Permalink
fix build probelm
Browse files Browse the repository at this point in the history
  • Loading branch information
naah69 committed Oct 21, 2022
1 parent d67c360 commit 81bd7c1
Show file tree
Hide file tree
Showing 16 changed files with 63 additions and 163 deletions.
2 changes: 1 addition & 1 deletion .github/project.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
release:
current-version: 1.30.0
current-version: 1.30.1-SNAPSHOT
next-version: 1.30.1-SNAPSHOT

4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ There are some demo in every `integration-tests` module.

### Main

- [x] quarkus-satoken-vertx
- [x] quarkus-satoken-resteasy
- [ ] quarkus-satoken-resteasy-reactive

Expand All @@ -54,8 +53,8 @@ There are some demo in every `integration-tests` module.
- [x] quarkus-satoken-sso
- [x] quarkus-satoken-aop(in quarkus-satoken-resteasy)
- [x] quarkus-satoken-dao-redis-jackson(based on quarkus-redisson)
- [x] quarkus-satoken-alone-redis(based on quarkus-redisson)
- [x] quarkus-satoken-context-dubbo
- [x] quarkus-satoken-alone-redis
- [ ] quarkus-satoken-dao-redis
- [ ] quarkus-satoken-dialect-thymeleaf
- [ ] quarkus-satoken-jwt
Expand All @@ -65,7 +64,6 @@ There are some demo in every `integration-tests` module.

It has not been tested in native mode yet.

- [ ] quarkus-satoken-vertx
- [ ] quarkus-satoken-resteasy
- [ ] quarkus-satoken-resteasy-reactive
- [ ] quarkus-satoken-oauth2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package io.quarkiverse.satoken.resteasy.it.integrate;

import javax.enterprise.context.ApplicationScoped;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.QueryParam;
Expand All @@ -33,7 +32,7 @@ public class LoginResource {
// 测试登录 ---- http://localhost:8081/acc/doLogin?name=zhang&pwd=123456
@POST
@Path("doLogin")
public SaResult doLogin(@FormParam("name") String name, @QueryParam("pwd") String pwd) {
public SaResult doLogin(@QueryParam("name") String name, @QueryParam("pwd") String pwd) {
// 此处仅作模拟示例,真实项目需要从数据库中查询数据进行比对
if ("zhang".equals(name) && "123456".equals(pwd)) {
StpUtil.login(10001);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public static void afterClass() {
public void clear() {
MockResteasyReactiveRequestContext.remove();
}

// 测试:基础API
@Test
public void testBasicsApi() {
Expand Down Expand Up @@ -93,13 +94,13 @@ public void testDoLogin() {
// API 验证
Assertions.assertTrue(StpUtil.isLogin());
Assertions.assertDoesNotThrow(() -> StpUtil.checkLogin());
Assertions.assertNotNull(token); // token不为null
Assertions.assertEquals(StpUtil.getLoginIdAsLong(), 10001); // loginId=10001
Assertions.assertEquals(StpUtil.getLoginIdAsInt(), 10001); // loginId=10001
Assertions.assertEquals(StpUtil.getLoginIdAsString(), "10001"); // loginId=10001
Assertions.assertEquals(StpUtil.getLoginId(), "10001"); // loginId=10001
Assertions.assertEquals(StpUtil.getLoginIdDefaultNull(), "10001"); // loginId=10001
Assertions.assertEquals(StpUtil.getLoginDevice(), SaTokenConsts.DEFAULT_LOGIN_DEVICE); // 登录设备类型
Assertions.assertNotNull(token); // token不为null
Assertions.assertEquals(StpUtil.getLoginIdAsLong(), 10001); // loginId=10001
Assertions.assertEquals(StpUtil.getLoginIdAsInt(), 10001); // loginId=10001
Assertions.assertEquals(StpUtil.getLoginIdAsString(), "10001"); // loginId=10001
Assertions.assertEquals(StpUtil.getLoginId(), "10001"); // loginId=10001
Assertions.assertEquals(StpUtil.getLoginIdDefaultNull(), "10001"); // loginId=10001
Assertions.assertEquals(StpUtil.getLoginDevice(), SaTokenConsts.DEFAULT_LOGIN_DEVICE); // 登录设备类型

// db数据 验证
// token存在
Expand Down Expand Up @@ -155,10 +156,10 @@ public void testSession() {
session.set("age", "18");
Assertions.assertEquals(session.get("name"), "zhang");
Assertions.assertEquals(session.getInt("age"), 18);
Assertions.assertEquals((int)session.getModel("age", int.class), 18);
Assertions.assertEquals((int)session.get("age", 20), 18);
Assertions.assertEquals((int)session.get("name2", 20), 20);
Assertions.assertEquals((int)session.get("name2", () -> 30), 30);
Assertions.assertEquals((int) session.getModel("age", int.class), 18);
Assertions.assertEquals((int) session.get("age", 20), 18);
Assertions.assertEquals((int) session.get("name2", 20), 20);
Assertions.assertEquals((int) session.get("name2", () -> 30), 30);
session.clear();
Assertions.assertEquals(session.get("name"), null);
}
Expand Down Expand Up @@ -346,7 +347,8 @@ public void testDisable() {
// 封号
StpUtil.disable(10007, 200);
Assertions.assertTrue(StpUtil.isDisable(10007));
Assertions.assertEquals(dao.get("satoken:login:disable:login:" + 10007), String.valueOf(SaTokenConsts.DEFAULT_DISABLE_LEVEL));
Assertions.assertEquals(dao.get("satoken:login:disable:login:" + 10007),
String.valueOf(SaTokenConsts.DEFAULT_DISABLE_LEVEL));

// 封号后检测一下 (会抛出 DisableLoginException 异常)
Assertions.assertThrows(DisableServiceException.class, () -> StpUtil.checkDisable(10007));
Expand All @@ -368,7 +370,8 @@ public void testDisableService() {
// 封掉评论功能
StpUtil.disable(10008, "comment", 200);
Assertions.assertTrue(StpUtil.isDisable(10008, "comment"));
Assertions.assertEquals(dao.get("satoken:login:disable:comment:" + 10008), String.valueOf(SaTokenConsts.DEFAULT_DISABLE_LEVEL));
Assertions.assertEquals(dao.get("satoken:login:disable:comment:" + 10008),
String.valueOf(SaTokenConsts.DEFAULT_DISABLE_LEVEL));
Assertions.assertNull(dao.get("satoken:login:disable:login:" + 10008));

// 封号后检测一下
Expand Down Expand Up @@ -547,19 +550,18 @@ public void testSafe() {
StpUtil.checkSafe();

// 自然结束
// Thread.sleep(2500);
// Assertions.assertFalse(StpUtil.isSafe());
// Thread.sleep(2500);
// Assertions.assertFalse(StpUtil.isSafe());

// 手动结束
// StpUtil.openSafe(2);
// StpUtil.openSafe(2);
StpUtil.closeSafe();
Assertions.assertFalse(StpUtil.isSafe());

// 抛异常
Assertions.assertThrows(NotSafeException.class, () -> StpUtil.checkSafe());
}


// ------------- 复杂点的

// 测试:指定设备登录
Expand Down Expand Up @@ -615,7 +617,6 @@ public void testDoLoginByTimeout() {
timeout = StpUtil.getTokenSessionTimeout();
Assertions.assertTrue(timeout >= 299);


// 注销后,就是-2
StpUtil.logout();
timeout = StpUtil.getTokenTimeout();
Expand Down Expand Up @@ -692,13 +693,12 @@ public void testActivityTimeout() {
// 默认跟随全局 timeout
StpUtil.updateLastActivityToNow();
long activityTimeout = StpUtil.getTokenActivityTimeout();
Assertions.assertTrue(activityTimeout <=180 || activityTimeout >=179);
Assertions.assertTrue(activityTimeout <= 180 || activityTimeout >= 179);

// 不会抛出异常
Assertions.assertDoesNotThrow(() -> StpUtil.checkActivityTimeout());
}


// 测试,上下文 API
@Test
public void testSaTokenContext() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ public Object getSource() {

/**
* if there is not @FormParam in Endpoint,the form data will not parsing.
*
* @see <a href="https://github.com/quarkusio/quarkus/discussions/25103">RESTEasy Reactive - get all form data</a>
* @see <a href="https://github.com/quarkusio/quarkus/issues/22444">RESTEasy Reactive: make body-reading filters force reading the body</a>
* @see <a href="https://github.com/quarkusio/quarkus/issues/22444">RESTEasy Reactive: make body-reading filters force
* reading the body</a>
* @param name param name
* @return param value
*/
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.quarkiverse.satoken</groupId>
<artifactId>quarkus-satoken-dao-alone-redis-parent</artifactId>
<version>1.30.0</version>
<version>1.30.1-SNAPSHOT</version>
</parent>
<artifactId>quarkus-satoken-dao-alone-redis-deployment</artifactId>
<name>Quarkus Satoken Dao Alone Redis - Deployment</name>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.quarkiverse.satoken</groupId>
<artifactId>quarkus-satoken-dao-alone-redis-parent</artifactId>
<version>1.30.0</version>
<version>1.30.1-SNAPSHOT</version>
</parent>
<artifactId>quarkus-satoken-dao-alone-redis-integration-tests</artifactId>
<name>Quarkus Satoken Dao Alone Redis - Integration Tests</name>
Expand Down
79 changes: 16 additions & 63 deletions quarkus-satoken-plugins/quarkus-satoken-dao-alone-redis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>quarkus-satoken-plugins</artifactId>
<groupId>io.quarkiverse.satoken</groupId>
<version>1.30.0</version>
<version>1.30.1-SNAPSHOT</version>
</parent>
<artifactId>quarkus-satoken-dao-alone-redis-parent</artifactId>
<packaging>pom</packaging>
Expand All @@ -15,66 +15,19 @@
<module>integration-tests</module>
<module>runtime</module>
</modules>
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<failsafe-plugin.version>${surefire-plugin.version}</failsafe-plugin.version>
<maven.compiler.release>11</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.version>2.10.1.Final</quarkus.version>
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom</artifactId>
<version>${quarkus.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.version}</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
<maven.repo>${settings.localRepository}</maven.repo>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${failsafe-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
<maven.repo>${settings.localRepository}</maven.repo>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

<profiles>
<profile>
<id>it</id>
<activation>
<property>
<name>performRelease</name>
<value>!true</value>
</property>
</activation>
<modules>
<module>integration-tests</module>
</modules>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.quarkiverse.satoken</groupId>
<artifactId>quarkus-satoken-dao-alone-redis-parent</artifactId>
<version>1.30.0</version>
<version>1.30.1-SNAPSHOT</version>
</parent>
<artifactId>quarkus-satoken-dao-alone-redis</artifactId>
<name>Quarkus Satoken Dao Alone Redis - Runtime</name>
Expand All @@ -24,7 +24,7 @@
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-extension-maven-plugin</artifactId>
<artifactId>quarkus-bootstrap-maven-plugin</artifactId>
<version>${quarkus.version}</version>
<executions>
<execution>
Expand All @@ -33,7 +33,8 @@
<goal>extension-descriptor</goal>
</goals>
<configuration>
<deployment>${project.groupId}:${project.artifactId}-deployment:${project.version}</deployment>
<deployment>${project.groupId}:${project.artifactId}-deployment:${project.version}
</deployment>
</configuration>
</execution>
</executions>
Expand Down
Loading

0 comments on commit 81bd7c1

Please sign in to comment.