Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. package com.aistemos.models;
  2.  
  3. import com.fasterxml.jackson.databind.ObjectMapper;
  4. import io.dropwizard.jackson.Jackson;
  5. import org.junit.Test;
  6.  
  7. import java.io.File;
  8. import java.io.IOException;
  9.  
  10. import static org.hamcrest.MatcherAssert.assertThat;
  11. import static org.hamcrest.core.Is.is;
  12.  
  13. public class SimpleTest {
  14.  
  15. private static final ObjectMapper MAPPER = Jackson.newObjectMapper();
  16.  
  17. @Test
  18. public void shouldDeserialize() throws IOException {
  19. final Simple actual = MAPPER.readValue(new File(SimpleTest.class.getResource("/fixtures/simple.json").getPath()),
  20. Simple.class);
  21.  
  22. Simple expected = ImmutableSimple.builder().name("simpleName").build();
  23. assertThat(actual, is(expected));
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement