Of course. This is a very common and important task in API development. Your team lead wants you to perform an end-to-end test to prove that your running application can accept a request, process it correctly, and return a response.
Based on the code you've provided, here is a step-by-step guide to doing exactly that using Postman.
The Goal
The objective is to send a valid JSON request to your running "Merchant-Intake" application. We want to see the application's logs show the request being processed by the filters (especially the DateFilter and RequestMdcFilter) and then receive a successful 200 OK response in Postman.
Step 1: Start Your Application
First, make sure your Spring Boot application is running. You can typically do this from your IDE (like IntelliJ or VS Code) or by running the mvn spring-boot:run command in your terminal.
You should see log messages in your console indicating that the application has started successfully on port 8385.
...
o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8385 (http) with context path ''
...
c.t.f.f.m.i.MerchantIntakeApplication : Started MerchantIntakeApplication in X.XXX seconds (JVM running for Y.YYY)
Step 2: Create and Configure the Request in Postman
Now, let's build the HTTP request in Postman.
A. Set the Method and URL
- Open Postman and click the
+button to create a new request. - Change the HTTP method from the default
GETtoPOST. -
In the URL bar, enter the address for your local endpoint. Based on your
FinNonmonController, you can use either/fraudcheckor/fraudeventcapturenonfin. Let's use/fraudcheck.URL:
http://localhost:8385/fraudcheck
B. Set the Headers
APIs need headers to understand the incoming request. The most important one here is Content-Type. Let's also add the TraceabilityID that your RequestMdcFilter looks for.
- Go to the Headers tab.
- Add the following two key-value pairs:
| Key | Value | Description |
|---|---|---|
Content-Type |
application/json |
Tells the server you are sending a JSON payload. |
TraceabilityID |
postman-test-12345 |
This will be picked up by RequestMdcFilter and added to your logs. |
C. Create the Request Body
This is the most critical part. You need to provide a JSON payload that matches the structure your application expects. Based on a detailed analysis of your filters and utility classes (DateFilter, RequestMdcFilter, ValidatorUtils), a valid request needs several key pieces of information.
- Go to the Body tab.
- Select the raw radio button.
- From the dropdown on the right that says
Text, select JSON. - Copy and paste the following JSON payload into the text area.
{
"fraudEvent": {
"initiationChannelInstance": [
{
"accessChannel": "WEB",
"processingChannel": "MERCHANT_PORTAL"
}
],
"authenticationInfo": {
"authenticationIdentity": [
{
"authenticationMethodTypeCd": "AccessCard",
"authenticateId": "1234567890123456"
}
]
}
},
"event": {
"financialEvent": [
{
"activityTypeCd": "PURCHASE",
"eventDttm": "2025-10-09T18:30:00",
"terminal": {
"localDttm": "2025-10-09T14:30:00"
}
}
]
}
}
Why this specific JSON?
-
"event"and"financialEvent": This structure is required to reach the data processed byDateFilterandCommonEventUtils. -
"eventDttm"and"localDttm": These fields will be targeted and reformatted by yourDateFilter. Notice they don't have aZat the end, which will test the logic in yourconvertToOffsetDateFormatmethod. -
"fraudEvent"and"initiationChannelInstance":RequestMdcFilteruses this to get theaccessChannelfor logging. -
"authenticationInfo": YourCommonValidator(viaValidatorUtils.isMandatoryAuthIdentityProvided) checks that at least one form of identification likeAccessCardis present. Without this, the request would likely be invalid. -
"activityTypeCd": This is extracted byRequestMdcFilterand put into the logs.
Step 3: Send the Request and Analyze the Results
Now you are ready to test.
A. Send the Request
Click the blue Send button in Postman.
B. Check the Postman Response
If everything is configured correctly, you should see the following in the bottom pane of Postman:
- Status Code:
200 OK. This is the most important indicator of success. It means your application received the request, processed it without any major errors, and sent back a normal response. - Response Body: The body will likely be an empty JSON object
{}. This is because your controller methodfraudCheckcurrently just doesvar fraudCheckEventResponse = new FraudCheckEventResponse();and returns it. This is perfectly fine for this test!
C. Check Your Application Logs
This is the "log it" part of your team lead's request. Look at the console where your Spring Boot application is running. You should see new log output that was generated by your request. Look for key indicators:
- Filter Initialization Logs: When the app starts, you see logs from
FilterConfigliketdDateFilter: ****Filter @Order(2) =*******tdDateFilter***********. -
MDC Logs: This is the key. Thanks to
RequestMdcFilter, your logs for this specific request should be automatically enriched with the context you provided. You will see theTraceabilityID,eventCode, andchannelIDin the log lines.A log line might look something like this (the format depends on your logging configuration):
2025-10-09 18:30:01.123 INFO [http-nio-8385-exec-1] [TraceabilityID=postman-test-12345] [eventCode=PURCHASE] [channelID=WEB] c.t.f.f.m.i.c.f.FinNonmonController : Starting fraud check process...Seeing these values from your Postman request appear in the server logs is proof that your filters and data extraction logic are working correctly.
What to Tell Your Team Lead
You can now confidently go to your team lead and say:
"I've tested the
/fraudcheckendpoint using Postman. I sent a valid request, and the application processed it successfully, returning a200 OKresponse. I've also confirmed in the logs that theRequestMdcFilteris correctly extracting the TraceabilityID and other details, and theDateFilteris processing the date fields as expected. The end-to-end flow is working."
Top comments (0)