Bump libs and tests

This commit is contained in:
Zixin 2022-02-17 00:19:49 +08:00
parent 86d3440c03
commit 227dd6bee1
5 changed files with 28 additions and 10 deletions

14
pom.xml
View file

@ -5,14 +5,14 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.2</version>
<version>2.6.3</version>
<relativePath/>
</parent>
<groupId>com.rebuild</groupId>
<artifactId>rebuild</artifactId>
<version>2.8.0-dev</version>
<name>rebuild</name>
<description>RB V2 use SpringBoot</description>
<description>Building your business-systems freely!</description>
<!-- UNCOMMENT USE TOMCAT -->
<!-- <packaging>war</packaging> -->
@ -289,6 +289,7 @@
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.9.7</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
@ -313,11 +314,12 @@
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-java-sdk</artifactId>
<version>7.9.1</version>
<version>7.9.3</version>
</dependency>
<dependency>
<groupId>com.github.whvcse</groupId>
@ -327,7 +329,7 @@
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>6.0.0</version>
<version>6.1.0</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
@ -403,7 +405,7 @@
<dependency>
<groupId>net.coobird</groupId>
<artifactId>thumbnailator</artifactId>
<version>0.4.15</version>
<version>0.4.16</version>
</dependency>
<dependency>
<groupId>es.moki.ratelimitj</groupId>
@ -418,7 +420,7 @@
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>3.16.7</version>
<version>3.16.8</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>

View file

@ -26,6 +26,7 @@ import org.springframework.cache.ehcache.EhCacheCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
import java.io.ByteArrayInputStream;
import java.io.File;
@ -48,7 +49,8 @@ public class BootConfiguration implements InstallState {
* Fake instance
* FIXME 直接 `==` 比较不安全 ???
*/
public static final JedisPool USE_EHCACHE = new JedisPool();
public static final JedisPool USE_EHCACHE = new JedisPool(
KnownJedisPool.DEFAULT_CONFIG, "127.0.0.1", 6379);
@Bean
JedisPool createJedisPool() {

View file

@ -18,13 +18,20 @@ public class KnownJedisPool extends JedisPool {
public static final int TIMEOUT = 5000;
public static final JedisPoolConfig DEFAULT_CONFIG = new JedisPoolConfig() {
@Override
public boolean getJmxEnabled() {
return false;
}
};
private String host;
private int port;
private String password;
private int database;
public KnownJedisPool(String host, int port, String password, int database) {
super(new JedisPoolConfig(), host, port, TIMEOUT, password, database);
super(DEFAULT_CONFIG, host, port, TIMEOUT, password, database);
this.host = host;
this.port = port;
this.password = password;

View file

@ -130,7 +130,7 @@ public class TestSupport {
if (!MetadataHelper.containsEntity(TestAllFields)) {
Entity2Schema entity2Schema = new Entity2Schema(UserService.ADMIN_USER);
String entityName = entity2Schema.createEntity(TestAllFields.toUpperCase(), null, null, false);
String entityName = entity2Schema.createEntity(TestAllFields.toUpperCase(), null, null, true);
Entity testEntity = MetadataHelper.getEntity(entityName);
for (DisplayType dt : DisplayType.values()) {

View file

@ -10,6 +10,7 @@ package com.rebuild.web;
import com.rebuild.TestSupport;
import com.rebuild.core.Application;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.web.context.WebApplicationContext;
@ -29,9 +30,15 @@ class BaseControllerTest extends TestSupport {
BaseController c = new BaseController() {
};
ApplicationContext context = Application.getContext();
if (!(context instanceof WebApplicationContext)) {
LOG.warn("None WebApplicationContext!");
return;
}
MockHttpServletRequest request = MockMvcRequestBuilders
.get("/user/login?name=a&int=123456&id=" + SIMPLE_USER)
.buildRequest(Objects.requireNonNull(((WebApplicationContext) Application.getContext()).getServletContext()));
.buildRequest(Objects.requireNonNull(((WebApplicationContext) context).getServletContext()));
assertEquals(c.getParameter(request, "name"), "a");