Update integration tests
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(){
|
||||
|
||||
Reference in New Issue
Block a user