Add @EnableEntityLinks to hypermedia support

This commit is contained in:
Dave Syer
2014-06-16 18:19:51 +01:00
parent 2ddf322a65
commit 571a82fe90
2 changed files with 21 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ package org.springframework.boot.autoconfigure.hateoas;
import org.junit.After;
import org.junit.Test;
import org.springframework.context.annotation.Configuration;
import org.springframework.hateoas.EntityLinks;
import org.springframework.hateoas.LinkDiscoverer;
import org.springframework.hateoas.LinkDiscoverers;
import org.springframework.hateoas.MediaTypes;
@@ -58,6 +59,15 @@ public class HypermediaAutoConfigurationTests {
assertTrue(HalLinkDiscoverer.class.isInstance(discoverer));
}
@Test
public void entityLinksCreated() throws Exception {
this.context = new AnnotationConfigWebApplicationContext();
this.context.register(HypermediaAutoConfiguration.class);
this.context.refresh();
EntityLinks discoverers = this.context.getBean(EntityLinks.class);
assertNotNull(discoverers);
}
@Test
public void doesBackOffIfEnableHypermediaSupportIsDeclaredManually() {