Package org.springframework.hateoas

Examples of org.springframework.hateoas.LinkDiscoverers


  @Test
  public void registersLinkDiscoverers() {

    ApplicationContext context = new AnnotationConfigApplicationContext(HalConfig.class);
    LinkDiscoverers discoverers = context.getBean(LinkDiscoverers.class);

    assertThat(discoverers, is(notNullValue()));
    assertThat(discoverers.getLinkDiscovererFor(MediaTypes.HAL_JSON), is(instanceOf(HalLinkDiscoverer.class)));
    assertRelProvidersSetUp(context);
  }
View Full Code Here


   * @param discoverer can be {@literal null}.
   * @return
   */
  public Traverson setLinkDiscoverers(List<? extends LinkDiscoverer> discoverer) {

    this.discoverers = discoverers == null ? DEFAULT_LINK_DISCOVERERS : new LinkDiscoverers(
        OrderAwarePluginRegistry.create(discoverer));

    return this;
  }
View Full Code Here

  @Test
  public void linkDiscoverersCreated() throws Exception {
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.register(HypermediaAutoConfiguration.class);
    this.context.refresh();
    LinkDiscoverers discoverers = this.context.getBean(LinkDiscoverers.class);
    assertNotNull(discoverers);
    LinkDiscoverer discoverer = discoverers.getLinkDiscovererFor(MediaTypes.HAL_JSON);
    assertTrue(HalLinkDiscoverer.class.isInstance(discoverer));
  }
View Full Code Here

TOP

Related Classes of org.springframework.hateoas.LinkDiscoverers

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.