mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
fix: boot run failed
This commit is contained in:
+4
-2
@@ -51,8 +51,10 @@ dependencies {
|
||||
}
|
||||
implementation 'org.apache.bcel:bcel:5.2'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-tomcat'
|
||||
implementation('org.springframework.boot:spring-boot-starter-web') {
|
||||
exclude group:'org.springframework.boot', module:'spring-boot-starter-tomcat'
|
||||
}
|
||||
implementation 'org.springframework.boot:spring-boot-starter-undertow'
|
||||
implementation 'com.google.code.gson:gson:2.11.0'
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.reajason.javaweb.boot.controller;
|
||||
|
||||
import com.reajason.javaweb.boot.entity.Config;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2024/12/13
|
||||
*/
|
||||
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public class ConfigControllerIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@Test
|
||||
public void testConfigEndpoint() {
|
||||
ResponseEntity<Config> response = restTemplate.getForEntity("/config", Config.class);
|
||||
|
||||
assertEquals(HttpStatus.OK, response.getStatusCode());
|
||||
|
||||
Config config = response.getBody();
|
||||
assertNotNull(config);
|
||||
assertNotNull(config.getServers());
|
||||
assertNotNull(config.getCore());
|
||||
assertNotNull(config.getPackers());
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.reajason.javaweb.boot.controller;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2024/12/13
|
||||
*/
|
||||
class ConfigControllerTest {
|
||||
@Test
|
||||
void getConfig() {
|
||||
ConfigController configController = new ConfigController();
|
||||
ResponseEntity<?> config = configController.config();
|
||||
Object body = config.getBody();
|
||||
assertNotNull(body);
|
||||
System.out.println(body);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user