Add test for encoding likes.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 25 Oct 2013 22:17:26 +0000 (00:17 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:25:44 +0000 (22:25 +0100)
src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java

index c7c46a0..8867a36 100644 (file)
@@ -204,4 +204,15 @@ public class AbstractSoneCommandTest {
                return postReply;
        }
 
+       @Test
+       public void testEncodingLikes() throws FSParseException {
+               List<Sone> likes = prepareMultipleSones();
+               SimpleFieldSet likesFieldSet = AbstractSoneCommand.encodeLikes(likes, "Prefix.");
+               assertThat(likesFieldSet, notNullValue());
+               assertThat(likesFieldSet.getInt("Prefix.Count"), is(likes.size()));
+               assertThat(likesFieldSet.get("Prefix.0.ID"), is(likes.get(0).getId()));
+               assertThat(likesFieldSet.get("Prefix.1.ID"), is(likes.get(1).getId()));
+               assertThat(likesFieldSet.get("Prefix.2.ID"), is(likes.get(2).getId()));
+       }
+
 }