Skip to content

Instantly share code, notes, and snippets.

@elaPa
Last active August 29, 2015 14:11
Show Gist options
  • Save elaPa/b0fdffe282633d746fe5 to your computer and use it in GitHub Desktop.
Save elaPa/b0fdffe282633d746fe5 to your computer and use it in GitHub Desktop.
package com.aistemos.models;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.dropwizard.jackson.Jackson;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
public class SimpleTest {
private static final ObjectMapper MAPPER = Jackson.newObjectMapper();
@Test
public void shouldDeserialize() throws IOException {
final Simple actual = MAPPER.readValue(new File(SimpleTest.class.getResource("/fixtures/simple.json").getPath()),
Simple.class);
Simple expected = ImmutableSimple.builder().name("simpleName").build();
assertThat(actual, is(expected));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment