Example usage for org.springframework.restdocs.operation.preprocess ContentModifyingOperationPreprocessor ContentModifyingOperationPreprocessor

List of usage examples for org.springframework.restdocs.operation.preprocess ContentModifyingOperationPreprocessor ContentModifyingOperationPreprocessor

Introduction

In this page you can find the example usage for org.springframework.restdocs.operation.preprocess ContentModifyingOperationPreprocessor ContentModifyingOperationPreprocessor.

Prototype

public ContentModifyingOperationPreprocessor(ContentModifier contentModifier) 

Source Link

Document

Create a new ContentModifyingOperationPreprocessor that will apply the given contentModifier to the operation's request or response.

Usage

From source file:capital.scalable.restdocs.response.ResponseModifyingPreprocessors.java

/**
 * For binary content, replaces value with "<binary>".
 *//*from   ww w.j  a  v a2s . com*/
public static OperationPreprocessor replaceBinaryContent() {
    return new ContentModifyingOperationPreprocessor(new BinaryReplacementContentModifier());
}

From source file:capital.scalable.restdocs.response.ResponseModifyingPreprocessors.java

/**
 * For JSON content, cuts the length of all JSON arrays in the response to 3 elements.
 *//*from www  .j  av  a 2 s.  co m*/
public static OperationPreprocessor limitJsonArrayLength(ObjectMapper objectMapper) {
    return new ContentModifyingOperationPreprocessor(new ArrayLimitingJsonContentModifier(objectMapper));
}