Update integration tests

This commit is contained in:
2024-04-28 16:25:39 -04:00
parent c6d98c72ef
commit 6a8b69371f
26 changed files with 227 additions and 16 deletions

View File

@@ -21,6 +21,18 @@ import lombok.extern.slf4j.Slf4j;
public class FullFilter extends OncePerRequestFilter{
@Override
protected void doFilterInternal(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response, @NonNull FilterChain filterChain) throws ServletException, IOException{
if(!request.getMethod().equalsIgnoreCase("OPTIONS")){
setupMDC(request);
}
//Continue to the controller
filterChain.doFilter(request, response);
//Clear the MDC for the next request
MDC.clear();
}
private void setupMDC(HttpServletRequest request){
//Get the requestId
if(request.getHeader("X-Request-Id") != null){
MDC.put("requestId", request.getHeader("X-Request-Id"));
@@ -56,11 +68,5 @@ public class FullFilter extends OncePerRequestFilter{
//Get the path
MDC.put("url", request.getRequestURI());
//Continue to the controller
filterChain.doFilter(request, response);
//Clear the MDC for the next request
MDC.clear();
}
}

View File

@@ -1,15 +1,15 @@
package com.mattrixwv.cipherstream.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Controller
@RestController
public class HealthCheckController{
@RequestMapping(value = "/health", method = RequestMethod.OPTIONS)
public void healthCheck(){