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

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

Introduction

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

Prototype

public void setMetadata(Map<String, String> metadata) 

Source Link

Usage

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

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

    Link profilesLink = client.discoverUnique("profiles");
    Link profileLink = assertHasContentLinkWithRel("self", client.request(profilesLink));

    Profile profile = new Profile();
    profile.setMetadata(Collections.singletonMap("Key", "Value"));

    putAndGet(profileLink, mapper.writeValueAsString(profile), MediaType.APPLICATION_JSON);

    client.follow(profileLink).andExpect(jsonPath("$.metadata.Key").value("Value"));
}