Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/test/java/com/adyen/model/nexo/MessageHeaderTest.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
package com.adyen.model.nexo;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The removal of the assertNull and assertNotNull imports suggests that test coverage for optional fields may be missing. The existing test only covers the happy path where all fields are present. To make the tests more robust, consider adding cases where optional MessageHeader fields (e.g., protocolVersion, serviceID, deviceID) are absent in the JSON. You can then assert that these fields are null after deserialization.


import com.adyen.terminal.serialization.TerminalAPIGsonBuilder;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import org.junit.jupiter.api.Test;

public class MessageHeaderTest {
Expand Down