Example usage for org.springframework.data.projection ProxyProjectionFactory createProjection

List of usage examples for org.springframework.data.projection ProxyProjectionFactory createProjection

Introduction

In this page you can find the example usage for org.springframework.data.projection ProxyProjectionFactory createProjection.

Prototype

@Override
    public <T> T createProjection(Class<T> projectionType) 

Source Link

Usage

From source file:org.springframework.data.projection.ProjectionIntegrationTests.java

@Test // DATACMNS-909
public void jacksonSerializationDoesNotExposeDecoratedClass() throws Exception {

    ProxyProjectionFactory factory = new ProxyProjectionFactory();
    SampleProjection projection = factory.createProjection(SampleProjection.class);

    ParseContext context = JsonPath//  w ww. ja va 2 s  .co m
            .using(new ConfigurationBuilder().options(Option.SUPPRESS_EXCEPTIONS).build());
    DocumentContext json = context.parse(new ObjectMapper().writeValueAsString(projection));

    assertThat(json.read("$.decoratedClass", String.class)).isNull();
}