X-Git-Url: https://git.pterodactylus.net/?p=jFCPlib.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2FModifyPeerNoteTest.java;fp=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2FModifyPeerNoteTest.java;h=f82e0120e347cef99482ca07963c3855266d6fbe;hp=0000000000000000000000000000000000000000;hb=19971c6f7a8c8b3a047199640e4dbab004f3ee99;hpb=6f3644e995d50f4d4e47b81985b298ad8dc50751 diff --git a/src/test/java/net/pterodactylus/fcp/ModifyPeerNoteTest.java b/src/test/java/net/pterodactylus/fcp/ModifyPeerNoteTest.java new file mode 100644 index 0000000..f82e012 --- /dev/null +++ b/src/test/java/net/pterodactylus/fcp/ModifyPeerNoteTest.java @@ -0,0 +1,28 @@ +package net.pterodactylus.fcp; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +import org.junit.Test; + +/** + * Unit test for {@link ModifyPeerNote}. + * + * @author David ‘Bombe’ Roden + */ +public class ModifyPeerNoteTest { + + private static final String IDENTIFIER = "identifier"; + private static final String NODE_IDENTIFIER = "node_identifier"; + private static final String ENCODED_NOTE_TEXT = "VWJlck5vZGUgKHVudGlsIEkgaGF2ZSByZWFsIHBlZXJzKQ=="; + private static final String DECODED_NOTE_TEXT = "UberNode (until I have real peers)"; + + @Test + public void noteTextIsEncodedCorrectly() { + ModifyPeerNote modifyPeerNote = new ModifyPeerNote(IDENTIFIER, NODE_IDENTIFIER); + modifyPeerNote.setNoteText(DECODED_NOTE_TEXT); + assertThat(modifyPeerNote.getField("NoteText"), is(ENCODED_NOTE_TEXT)); + } + + +}