DATACMNS-471 - Added sample config files for PagedResourcesAssembler setup in XML.
Related issues: Spring HATEOAS - #161.
This commit is contained in:
@@ -26,6 +26,7 @@ import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.core.SpringVersion;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
@@ -79,6 +80,28 @@ public class PageableResourcesAssemblerIntegrationTests {
|
||||
assertThat(resources.getLink(Link.REL_SELF), is(notNullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACMNS-471
|
||||
*/
|
||||
@Test
|
||||
public void setsUpPagedResourcesAssemblerFromManualXmlConfig() {
|
||||
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("manual.xml", getClass());
|
||||
assertThat(context.getBean(PagedResourcesAssembler.class), is(notNullValue()));
|
||||
context.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACMNS-471
|
||||
*/
|
||||
@Test
|
||||
public void setsUpPagedResourcesAssemblerFromJavaConfigXmlConfig() {
|
||||
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("via-config-class.xml", getClass());
|
||||
assertThat(context.getBean(PagedResourcesAssembler.class), is(notNullValue()));
|
||||
context.close();
|
||||
}
|
||||
|
||||
@Controller
|
||||
static class SampleController {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user