package com.uwetrottmann.getglue.services;

import com.uwetrottmann.getglue.BaseTestCase;
import com.uwetrottmann.getglue.entities.GetGlueInteraction;
import com.uwetrottmann.getglue.entities.GetGlueInteractionResource;

import java.util.List;

import static org.fest.assertions.api.Assertions.assertThat;

public class InteractionServiceTest extends BaseTestCase {


    public static final String SAMPLE_INTERACTION = "getgluejava/2013-10-24T18:30:38Z";

    public void test_get() {
        InteractionService service = getManager().interactionService();
        GetGlueInteractionResource resource = service.get(SAMPLE_INTERACTION);
        assertThat(resource).isNotNull();
        assertThat(resource.interaction).isNotNull();
        assertThat(resource.interaction._object).isNotNull();
        assertThat(resource.interaction._object.id).isEqualTo("tv_shows/how_i_met_your_mother");
        assertThat(resource.interaction._object.title).isEqualTo("How I Met Your Mother");
    }

    public void test_votes() {
        InteractionService service = getManager().interactionService();
        List<GetGlueInteraction> resource = service.votes(SAMPLE_INTERACTION);
        assertThat(resource).isNotNull();
    }

    public void test_replies() {
        InteractionService service = getManager().interactionService();
        List<GetGlueInteraction> resource = service.replies(SAMPLE_INTERACTION);
        assertThat(resource).isNotNull();
    }

}

@@ -972,24 +972,109 @@
 r Mother%22);%0A
+        assertThat(resource.interaction.comment).isEqualTo(%22Testing getglue-java.%22);%0A
     %7D%0A%0A    p

Test for new comment property.