šŸ—‘ļø Deprecate SendBookmarkFeed message
authorDavid ā€˜Bombe’ Roden <bombe@freenetproject.org>
Mon, 6 Jan 2025 10:27:37 +0000 (11:27 +0100)
committerDavid ā€˜Bombe’ Roden <bombe@freenetproject.org>
Mon, 6 Jan 2025 10:27:53 +0000 (11:27 +0100)
src/main/java/net/pterodactylus/fcp/SendBookmarkFeed.java
src/test/java/net/pterodactylus/fcp/SendBookmarkFeedTest.java [new file with mode: 0644]

index 71fe1c1..9575a2e 100644 (file)
@@ -21,7 +21,10 @@ package net.pterodactylus.fcp;
  * The ā€œSendBookmarkFeedā€ command sends a bookmark to a peer.
  *
  * @author David ā€˜Bombe’ Roden &lt;bombe@freenetproject.org&gt;
+ * @deprecated Use {@link SendBookmark} instead,
+ *        {@code SendBookmarkFeed} was removed in Hyphanet build 1236.
  */
+@Deprecated
 public class SendBookmarkFeed extends AbstractSendFeedMessage {
 
        /**
diff --git a/src/test/java/net/pterodactylus/fcp/SendBookmarkFeedTest.java b/src/test/java/net/pterodactylus/fcp/SendBookmarkFeedTest.java
new file mode 100644 (file)
index 0000000..3af9e98
--- /dev/null
@@ -0,0 +1,47 @@
+package net.pterodactylus.fcp;
+
+import org.junit.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalTo;
+
+public class SendBookmarkFeedTest {
+
+       @Test
+       public void sendBookmarkFeedMessageHasCorrectName() {
+               assertThat(sendBookmarkFeed.getName(), equalTo("SendBookmarkFeed"));
+       }
+
+       @Test
+       public void sendBookmarkFeedMessageSetsIdentifierFieldCorrectly() {
+               assertThat(sendBookmarkFeed.getField("Identifier"), equalTo("identifier"));
+       }
+
+       @Test
+       public void sendBookmarkFeedMessageSetsNodeIdentifierFieldCorrectly() {
+               assertThat(sendBookmarkFeed.getField("NodeIdentifier"), equalTo("node-identifier"));
+       }
+
+       @Test
+       public void sendBookmarkFeedMessageSetsNameFieldCorrectly() {
+               assertThat(sendBookmarkFeed.getField("Name"), equalTo("name"));
+       }
+
+       @Test
+       public void sendBookmarkFeedMessageSetsUriFieldCorrectly() {
+               assertThat(sendBookmarkFeed.getField("URI"), equalTo("uri"));
+       }
+
+       @Test
+       public void sendBookmarkFeedMessageSetsDescriptionFieldCorrectly() {
+               assertThat(sendBookmarkFeed.getField("Description"), equalTo("description"));
+       }
+
+       @Test
+       public void sendBookmarkFeedMessageSetsHasActiveLinkFieldCorrectly() {
+               assertThat(sendBookmarkFeed.getField("HasActiveLink"), equalTo("true"));
+       }
+
+       private final SendBookmarkFeed sendBookmarkFeed = new SendBookmarkFeed("identifier", "node-identifier", "name", "uri", "description", true);
+
+}