DefaultRelationBuilder implements RelationBuilder { public WithName relation(String name) { return new WithNameImpl(name); } DefaultRelationBuilder(Router router, Proxifier proxifier); void add(Relation relation); WithName relation(String name); List<Relation> getRelations(); T relation(final Class<T> type);  }
@Test public void shouldAllowRelationCreationToSpecificURIs() { builder.relation("payment").at("http: assertThat(builder, hasRelation("payment", "http: }
@Test public void shouldBuildRelationsOfControllersUsingMethodNameByDefault() throws Exception { when(router.urlFor(Controller.class, doIt)).thenReturn("http: builder.relation(Controller.class).doIt(); assertThat(builder, hasRelation("doIt", "http: }
@Test public void shouldBuildRelationsOfControllersUsingGivenName() throws Exception { when(router.urlFor(Controller.class, doIt)).thenReturn("http: builder.relation("payment").uses(Controller.class).doIt(); assertThat(builder, hasRelation("payment", "http: }