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;
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

While this import is unused in the current code, consider re-adding it and using assertNotNull to verify that the deserializedMessageHeader object is not null after deserialization. This improves test clarity and provides a more specific error message if terminalApiGson.fromJson were to return null, which can aid in faster debugging.

For example, you could add the following after line 20:

assertNotNull(deserializedMessageHeader);

import static org.junit.jupiter.api.Assertions.assertNull;

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