package net.mollywhite.mbta.api;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;

import static io.dropwizard.testing.FixtureHelpers.fixture;
import static org.junit.Assert.assertEquals;

public class TweetTest {
  private static final ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

  @Test
  public void deserializesFromJSON() throws Exception {
    Tweet expected = new Tweet(
        "Sun Jun 14 22:34:47 +0000 2015",
        "610213825237884929",
        "@MBTA @MBTA_CR @BostonGlobe @7News in this case silence is not Golden can someone share with the people on this train when they will be off?",
        "610210856945606656",
        "150334831",
        "MBTA",
        new User(),
        null,
        null,
        null,
        0,
        0,
        new Entities(),
        "1434321287818"
    );
    Tweet actual = mapper.readValue(fixture("fixtures/TweetWithReplyToFixture.json"), Tweet.class);
    assertEquals(expected, actual);
  }
}

@@ -152,20 +152,142 @@
 ort 
-org.junit.Te
+com.google.common.collect.Lists;%0Aimport org.junit.Test;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0Aimport java.util.Li
 st;%0A
@@ -624,432 +624,1327 @@
     
-Tweet expected = new Tweet(%0A        %22Sun Jun 14 22:34:47 +0000 2015%22,%0A        %22610213825237884929%22,%0A        %22@MBTA @MBTA_CR @BostonGlobe @7News in this case silence is not Golden can someone share with the people on this train when they will be off?%22,%0A        %22610210856945606656%22,%0A        %22150334831%22,%0A        %22MBTA%22,%0A        new User(),%0A        null,%0A        null,%0A        null,%0A        0,%0A        0,%0A        new Entities(
+List%3CUserMention%3E users = new ArrayList%3CUserMention%3E();%0A    users.add(new UserMention(%22150334831%22, Lists.newArrayList(0, 5), %22MBTA%22, %22MBTA%22));%0A    users.add(new UserMention(%222535372901%22, Lists.newArrayList(6, 14), %22MBTA Commuter Rail%22, %22MBTA_CR%22));%0A    users.add(new UserMention(%2295431448%22, Lists.newArrayList(15, 27), %22The Boston Globe%22, %22BostonGlobe%22));%0A    users.add(new UserMention(%2216558796%22, Lists.newArrayList(28, 34), %227News Boston%22, %227News%22));%0A    Tweet expected = new Tweet(%0A        %22Sun Jun 14 22:34:47 +0000 2015%22,%0A        %22610213825237884929%22,%0A        %22@MBTA @MBTA_CR @BostonGlobe @7News in this case silence is not Golden can someone share with the people on this train when they will be off?%22,%0A        %22610210856945606656%22,%0A        %22150334831%22,%0A        %22MBTA%22,%0A        new User(%0A            %22243519639%22,%0A            %22John Casey%22,%0A            %22johncaseywick%22,%0A            %22http://pbs.twimg.com/profile_images/2789497755/aee93b828a8f95c8d5b0eb14e82947ad_normal.jpeg%22,%0A            %22https://pbs.twimg.com/profile_images/2789497755/aee93b828a8f95c8d5b0eb14e82947ad_normal.jpeg%22%0A        ),%0A        null,%0A        null,%0A        null,%0A        0,%0A        0,%0A        new Entities(%0A            Collections.%3CHashtag%3E emptyList(),%0A            null,%0A            Collections.%3CURL%3E emptyList(),%0A            users%0A        
 ),%0A 
@@ -1973,16 +1973,17 @@
 %0A    );%0A
+%0A
     Twee

Fix Tweet test