public class DependencyUnmarshallerTest extends UnmarshallerTestCase {
@Test
public void toModel() {
Dependency dependency = new DependencyUnmarshaller().toModel("[]");
assertThat(dependency, nullValue());
dependency = new DependencyUnmarshaller().toModel(loadFile("/dependencies/single.json"));
assertThat(dependency.getId(), is("1649"));
assertThat(dependency.getFromId(), is(33L));
assertThat(dependency.getFromKey(), is("org.apache.shiro:shiro-core:org.apache.shiro.authc.pam"));
assertThat(dependency.getToId(), is(45L));
assertThat(dependency.getToKey(), is("org.apache.shiro:shiro-core:org.apache.shiro.realm"));
assertThat(dependency.getUsage(), is("USES"));
assertThat(dependency.getWeight(), is(5));
assertThat(dependency.getFromName(), is("pam"));
assertThat(dependency.getToName(), is("realm"));
assertThat(dependency.getFromQualifier(), is("PAC"));
assertThat(dependency.getToQualifier(), is("PAC"));
}