-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 删除了初始的 index.html 文件,该文件包含静态内容和Bootstrap样式
- 移除了 QueryHelperTest 类,该类包含对 QueryHelper 类的单元测试 - 添加了 WebConfigurationTest 类,该类为测试配置类,设置了自定义参数解析器 - 删除了 UsersControllerTest 类,该类包含对 UsersController 的集成测试 - 更新了 BootApplicationTest 类,添加了 WebConfigurationTest 的导入,并调整了测试方法的名称 - 添加了 application-test.yml 文件,配置了日志、数据库连接、Redis和OAuth2客户端注册信息
- Loading branch information
Showing
6 changed files
with
73 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +0,0 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<!-- Required meta tags --> | ||
<meta charset="utf-8"> | ||
<meta content="width=device-width, initial-scale=1" name="viewport"> | ||
<title>管理平台</title> | ||
<!-- Bootstrap CSS --> | ||
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" rel="stylesheet"> | ||
<style> | ||
html, body { | ||
height: 100%; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container h-100"> | ||
<div class="d-flex align-items-center h-100"> | ||
<div class="card" style="width: 36rem"> | ||
<div class="card-body"> | ||
<h1 class="card-title">欢迎使用服务!</h1> | ||
<p class="card-text">最好用的API调试页面!</p> | ||
<a class="btn btn-primary btn-lg" href="./" role="button">Swagger Api 文档</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<script crossorigin="anonymous" | ||
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script> | ||
</body> | ||
</html> | ||
13 changes: 10 additions & 3 deletions
13
boot/platform/src/test/java/com/plate/boot/BootApplicationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
package com.plate.boot; | ||
|
||
import com.plate.boot.config.WebConfigurationTest; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.context.annotation.Import; | ||
|
||
import java.security.*; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
/** | ||
* @author <a href="https://github.com/vnobo">Alex Bob</a> | ||
*/ | ||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = "spring.profiles.active=test") | ||
@Import({WebConfigurationTest.class}) | ||
class BootApplicationTest { | ||
|
||
@Test | ||
void contextLoads() throws NoSuchAlgorithmException { | ||
void contextLoadsTest() throws NoSuchAlgorithmException { | ||
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); | ||
keyPairGenerator.initialize(2048); | ||
KeyPair keyPair = keyPairGenerator.generateKeyPair(); | ||
PrivateKey privateKey = keyPair.getPrivate(); | ||
PublicKey publicKey = keyPair.getPublic(); | ||
System.out.println(privateKey); | ||
System.out.println(publicKey); | ||
assertThat(privateKey).isNotNull(); | ||
assertThat(publicKey).isNotNull(); | ||
} | ||
} |
98 changes: 0 additions & 98 deletions
98
boot/platform/src/test/java/com/plate/boot/commons/utils/query/QueryHelperTest.java
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
boot/platform/src/test/java/com/plate/boot/config/WebConfigurationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.plate.boot.config; | ||
|
||
import org.springframework.boot.test.context.TestConfiguration; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.web.ReactivePageableHandlerMethodArgumentResolver; | ||
import org.springframework.web.reactive.config.WebFluxConfigurer; | ||
import org.springframework.web.reactive.result.method.annotation.ArgumentResolverConfigurer; | ||
|
||
/** | ||
* Configures web-related settings and behaviors for an application, including RSocket setup, | ||
* scheduling, asynchronous method handling, and custom argument resolvers for reactive environments. | ||
* This configuration class integrates with Spring's WebFlux features to enable functionalities | ||
* like scheduling tasks, processing asynchronous requests, and defining custom argument resolving | ||
* strategies for handler methods. | ||
*/ | ||
@TestConfiguration(proxyBeanMethods = false) | ||
public class WebConfigurationTest implements WebFluxConfigurer { | ||
/** | ||
* Configures custom argument resolvers for handler methods in a reactive environment. | ||
* This method specifically sets up a {@link ReactivePageableHandlerMethodArgumentResolver} | ||
* to handle {@link Pageable} arguments, limiting the maximum page size and setting a default | ||
* fallback page size when none is provided. | ||
* | ||
* @param configurer The {@link ArgumentResolverConfigurer} used to register custom argument resolvers. | ||
*/ | ||
@Override | ||
public void configureArgumentResolvers(ArgumentResolverConfigurer configurer) { | ||
ReactivePageableHandlerMethodArgumentResolver pageableResolver = | ||
new ReactivePageableHandlerMethodArgumentResolver(); | ||
pageableResolver.setMaxPageSize(100); | ||
pageableResolver.setFallbackPageable(Pageable.ofSize(25)); | ||
configurer.addCustomResolver(pageableResolver); | ||
} | ||
|
||
} |
171 changes: 0 additions & 171 deletions
171
boot/platform/src/test/java/com/plate/boot/security/core/user/UsersControllerTest.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.