IncludeTest.java 文件源码

java
阅读 28 收藏 0 点赞 0 评论 0

项目:rest-modeling-framework 作者:
@Test
public void load() throws IOException {
    final Resource resource = fromClasspath("/data-type-include.raml");
    assertThat(resource.getErrors()).hasSize(0);

    final Library library = getRootObject(resource);
    final EList<AnyType> types = library.getTypes();

    assertThat(types).hasSize(1);
    assertThat(types.get(0)).isInstanceOf(ObjectType.class);

    final ObjectType personType = (ObjectType) types.get(0);

    assertThat(personType.getName()).isEqualTo("Person");
    assertThat(personType.getDisplayName()).isEqualTo("Person");
    assertThat(personType.getProperties()).hasSize(1);

    final Property ageProperty = personType.getProperties().get(0);

    assertThat(ageProperty.getName()).isEqualTo("age");
    assertThat(ageProperty.getType().getName()).isEqualTo("integer");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号