Package org.springframework.hateoas

Examples of org.springframework.hateoas.EntityLinks.supports()


  public void registersControllerForEntity() {

    when(linkBuilderFactory.linkTo(SampleController.class, new Object[0])).thenReturn(linkTo(SampleController.class));
    EntityLinks links = new ControllerEntityLinks(Arrays.asList(SampleController.class), linkBuilderFactory);

    assertThat(links.supports(Person.class), is(true));
    assertThat(links.linkFor(Person.class), is(notNullValue()));
  }

  /**
   * @see #43
View Full Code Here


  public void rejectsUnmanagedEntity() {

    EntityLinks links = new ControllerEntityLinks(
        Arrays.asList(SampleController.class, ControllerWithParameters.class), linkBuilderFactory);

    assertThat(links.supports(Person.class), is(true));
    assertThat(links.supports(Order.class), is(true));
    assertThat(links.supports(SampleController.class), is(false));

    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage(SampleController.class.getName());
View Full Code Here

    EntityLinks links = new ControllerEntityLinks(
        Arrays.asList(SampleController.class, ControllerWithParameters.class), linkBuilderFactory);

    assertThat(links.supports(Person.class), is(true));
    assertThat(links.supports(Order.class), is(true));
    assertThat(links.supports(SampleController.class), is(false));

    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage(SampleController.class.getName());
    thrown.expectMessage(ExposesResourceFor.class.getName());
View Full Code Here

    EntityLinks links = new ControllerEntityLinks(
        Arrays.asList(SampleController.class, ControllerWithParameters.class), linkBuilderFactory);

    assertThat(links.supports(Person.class), is(true));
    assertThat(links.supports(Order.class), is(true));
    assertThat(links.supports(SampleController.class), is(false));

    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage(SampleController.class.getName());
    thrown.expectMessage(ExposesResourceFor.class.getName());
    links.linkFor(SampleController.class);
View Full Code Here

  @Test
  public void supportsDomainTypeBackedByPlugin() {

    EntityLinks links = createDelegatingEntityLinks();

    assertThat(links.supports(String.class), is(true));
  }

  @Test
  public void delegatesLinkForCall() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.