@Test public void foo() { CollectionResourceMapping mapping = factory.getMappingForType(Person.class); assertThat(mapping.getPath(), is("person")); assertThat(mapping.getRel(), is("person")); assertThat(mapping.getSingleResourceRel(), is("person.person")); }
@Test public void honorsAnnotatedsMapping() { CollectionResourceMapping mapping = factory.getMappingForType(PersonRepository.class); assertThat(mapping.getPath(), is("bar")); assertThat(mapping.getRel(), is("foo")); assertThat(mapping.getSingleResourceRel(), is("foo.foo")); assertThat(mapping.isExported(), is(false)); }
@Test public void repositoryAnnotationTrumpsDomainTypeMapping() { CollectionResourceMapping mapping = factory.getMappingForType(AnnotatedAnnotatedPersonRepository.class); assertThat(mapping.getPath(), is("trumpsAll")); assertThat(mapping.getRel(), is("foo")); assertThat(mapping.getSingleResourceRel(), is("foo.foo")); assertThat(mapping.isExported(), is(true)); }