Example usage for org.springframework.data.rest.tests.mongodb Profile getId

List of usage examples for org.springframework.data.rest.tests.mongodb Profile getId

Introduction

In this page you can find the example usage for org.springframework.data.rest.tests.mongodb Profile getId.

Prototype

public String getId() 

Source Link

Usage

From source file:org.springframework.data.rest.tests.mongodb.MongoWebTests.java

/**
 * @see DATAREST-471// w  w  w.j  a  v  a2  s  . c om
 */
@Test
public void auditableResourceHasLastModifiedHeaderSet() throws Exception {

    Profile profile = repository.findAll().iterator().next();

    String header = mvc.perform(get("/profiles/{id}", profile.getId())).//
            andReturn().getResponse().getHeader("Last-Modified");

    assertThat(header, not(isEmptyOrNullString()));
}

From source file:org.springframework.data.rest.tests.mongodb.MongoWebTests.java

/**
 * @see DATAREST-511/*from   ww  w. j  a  v a 2  s. c  o  m*/
 */
@Test
public void invokesQueryResourceReturningAnOptional() throws Exception {

    Profile profile = repository.findAll().iterator().next();

    Link link = client.discoverUnique("profiles", "search", "findById");

    mvc.perform(get(link.expand(profile.getId()).getHref())).//
            andExpect(status().isOk());
}