Java Code Examples for org.springframework.hateoas.PagedModel#getContent()

The following examples show how to use org.springframework.hateoas.PagedModel#getContent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FeignHalTests.java    From spring-cloud-openfeign with Apache License 2.0 6 votes vote down vote up
@Test
public void testPagedModel() {
	PagedModel<MarsRover> paged = feignHalClient.paged();
	assertThat(paged).isNotNull();
	assertThat(paged).isNotEmpty();

	assertThat(paged.hasLinks()).isTrue();
	assertThat(paged.hasLink("self")).isTrue();

	assertThat(paged.getLink("self")).map(Link::getHref).contains("/paged");

	Collection<MarsRover> collection = paged.getContent();
	assertThat(collection).isNotEmpty();

	MarsRover marsRover = collection.stream().findAny().orElse(null);
	assertThat(marsRover).isNotNull();
	assertThat(marsRover.getName()).isEqualTo("Curiosity");
}
 
Example 2
Source File: CatalogClient.java    From microservice with Apache License 2.0 5 votes vote down vote up
@HystrixCommand(fallbackMethod = "getItemsCache", commandProperties = {
		@HystrixProperty(name = "circuitBreaker.requestVolumeThreshold", value = "2") })
public Collection<Item> findAll() {
	PagedModel<Item> pagedResources = restTemplate.getForObject(
			catalogURL(), ItemPagedResources.class);
	this.itemsCache = pagedResources.getContent();
	return pagedResources.getContent();
}
 
Example 3
Source File: CustomerClient.java    From microservice-kubernetes with Apache License 2.0 4 votes vote down vote up
public Collection<Customer> findAll() {
	PagedModel<Customer> pagedModel = getRestTemplate().getForObject(customerURL(),
			CustomerPagedModel.class);
	return pagedModel.getContent();
}
 
Example 4
Source File: CustomerClient.java    From microservice-kubernetes with Apache License 2.0 4 votes vote down vote up
public Collection<Customer> findAll() {
	PagedModel<Customer> pagedResources = getRestTemplate().getForObject(customerURL(),
			CustomerPagedResources.class);
	return pagedResources.getContent();
}
 
Example 5
Source File: CatalogClient.java    From microservice-kubernetes with Apache License 2.0 4 votes vote down vote up
public Collection<Item> findAll() {
	PagedModel<Item> pagedResources = restTemplate.getForObject(catalogURL(), ItemPagedResources.class);
	return pagedResources.getContent();
}
 
Example 6
Source File: CatalogClient.java    From microservice-kubernetes with Apache License 2.0 4 votes vote down vote up
public Collection<Item> findAll() {
	PagedModel<Item> pagedResources = restTemplate.getForObject(catalogURL(), ItemPagedResources.class);
	return pagedResources.getContent();
}
 
Example 7
Source File: CustomerClient.java    From microservice with Apache License 2.0 4 votes vote down vote up
public Collection<Customer> findAll() {
	PagedModel<Customer> pagedResources = getRestTemplate()
															.getForObject(customerURL(),
																	CustomerPagedResources.class);
	return pagedResources.getContent();
}
 
Example 8
Source File: CatalogClient.java    From microservice with Apache License 2.0 4 votes vote down vote up
public Collection<Item> findAll() {
	PagedModel<Item> pagedResources = restTemplate.getForObject(
			catalogURL(), ItemPagedResources.class);
	return pagedResources.getContent();
}
 
Example 9
Source File: CustomerClient.java    From microservice with Apache License 2.0 4 votes vote down vote up
public Collection<Customer> findAll() {
	PagedModel<Customer> pagedResources = getRestTemplate()
															.getForObject(customerURL(),
																	CustomerPagedResources.class);
	return pagedResources.getContent();
}