✅ Add test for ListPeerNotes
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Thu, 2 Jan 2025 22:06:47 +0000 (23:06 +0100)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Thu, 2 Jan 2025 22:06:47 +0000 (23:06 +0100)
src/test/java/net/pterodactylus/fcp/ListPeerNotesTest.java [new file with mode: 0644]

diff --git a/src/test/java/net/pterodactylus/fcp/ListPeerNotesTest.java b/src/test/java/net/pterodactylus/fcp/ListPeerNotesTest.java
new file mode 100644 (file)
index 0000000..622842f
--- /dev/null
@@ -0,0 +1,23 @@
+package net.pterodactylus.fcp;
+
+import org.junit.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalTo;
+
+public class ListPeerNotesTest {
+
+       @Test
+       public void listPeerNotesWithNodeIdentifierSetsNodeIdentifierField() {
+               ListPeerNotes listPeerNotes = new ListPeerNotes("node-identifier");
+               assertThat(listPeerNotes.getField("NodeIdentifier"), equalTo("node-identifier"));
+       }
+
+       @Test
+       public void listPeerNotesWithIdentifierAndNodeIdentifierSetsIdentifierAndNodeIdentifierField() {
+               ListPeerNotes listPeerNotes = new ListPeerNotes("identifier", "node-identifier");
+               assertThat(listPeerNotes.getField("Identifier"), equalTo("identifier"));
+               assertThat(listPeerNotes.getField("NodeIdentifier"), equalTo("node-identifier"));
+       }
+
+}