mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-23 07:21:53 +08:00
refactor: simplify config build
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package com.reajason.javaweb.memshell.config;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2025/8/26
|
||||
*/
|
||||
class AntSwordConfigTest {
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
AntSwordConfig antSwordConfig = AntSwordConfig.builder()
|
||||
.pass("")
|
||||
.headerName(null)
|
||||
.headerValue("").build();
|
||||
assertNotNull(antSwordConfig.getPass());
|
||||
assertNotNull(antSwordConfig.getHeaderName());
|
||||
assertNotNull(antSwordConfig.getHeaderValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testInit(){
|
||||
AntSwordConfig antSwordConfig = AntSwordConfig.builder()
|
||||
.pass("pass")
|
||||
.headerName("ua")
|
||||
.headerValue("v").build();
|
||||
assertEquals("pass", antSwordConfig.getPass());
|
||||
assertEquals("ua", antSwordConfig.getHeaderName());
|
||||
assertEquals("v", antSwordConfig.getHeaderValue());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.reajason.javaweb.memshell.config;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2025/8/26
|
||||
*/
|
||||
class BehinderConfigTest {
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
BehinderConfig behinderConfig = BehinderConfig.builder()
|
||||
.pass(null)
|
||||
.headerName("")
|
||||
.headerValue("").build();
|
||||
assertNotNull(behinderConfig.getPass());
|
||||
assertNotNull(behinderConfig.getHeaderName());
|
||||
assertNotNull(behinderConfig.getHeaderValue());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.reajason.javaweb.memshell.config;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2025/8/25
|
||||
*/
|
||||
class GodzillaConfigTest {
|
||||
|
||||
@Test
|
||||
void testNull() {
|
||||
GodzillaConfig godzillaConfig = GodzillaConfig.builder()
|
||||
.pass(null)
|
||||
.key("")
|
||||
.headerName(null)
|
||||
.headerValue("")
|
||||
.build();
|
||||
assertNotNull(godzillaConfig.getPass());
|
||||
assertNotNull(godzillaConfig.getKey());
|
||||
assertNotNull(godzillaConfig.getHeaderName());
|
||||
assertNotNull(godzillaConfig.getHeaderValue());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user