405问题日志添加
This commit is contained in:
1 parent
4818f25d8f
commit
43dec4c94b
5 files changed
+134
-4
No files matched your search
+6
-2
@@ -2,6 +2,7 @@ package com.ruoyi.web.controller.system;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.ruoyi.system.controller.WebhookDebugController;
|
||||
import com.ruoyi.system.controller.WebhookDebugTraceFilter;
|
||||
import com.ruoyi.system.rental.RentalCrypto;
|
||||
import com.ruoyi.system.rental.RentalStore;
|
||||
import org.junit.Test;
|
||||
@@ -58,8 +59,11 @@ public class WebhookDebugControllerTest {
|
||||
}
|
||||
|
||||
@Test public void postMappingAndMissingConfigurationAreExplicit() throws Exception {
|
||||
MockMvc mvc = MockMvcBuilders.standaloneSetup(controller).build();
|
||||
mvc.perform(get("/api/webhook/debug")).andExpect(status().isMethodNotAllowed());
|
||||
MockMvc mvc = MockMvcBuilders.standaloneSetup(controller).addFilters(new WebhookDebugTraceFilter()).build();
|
||||
mvc.perform(get("/api/webhook/debug").header("X-Rent-Callback-Id", "test-callback"))
|
||||
.andExpect(status().isMethodNotAllowed())
|
||||
.andExpect(header().string("X-Rent-Debug-Backend", "ruoyi-webhook-debug-v1"))
|
||||
.andExpect(header().string("X-Rent-Callback-Id", "test-callback"));
|
||||
mvc.perform(post("/api/webhook/debug").contentType("application/json").content(body))
|
||||
.andExpect(status().isServiceUnavailable());
|
||||
configure();
|
||||
|
||||
Reference in new issue
Block a user