Search in sources :

Example 36 with SimpleFilterProvider

use of com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider in project gravitee-management-rest-api by gravitee-io.

the class ApiService_FindByIdTest method setUp.

@Before
public void setUp() {
    PropertyFilter apiMembershipTypeFilter = new ApiPermissionFilter();
    objectMapper.setFilterProvider(new SimpleFilterProvider(Collections.singletonMap("apiMembershipTypeFilter", apiMembershipTypeFilter)));
}
Also used : SimpleFilterProvider(com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider) PropertyFilter(com.fasterxml.jackson.databind.ser.PropertyFilter) ApiPermissionFilter(io.gravitee.management.service.jackson.filter.ApiPermissionFilter) Before(org.junit.Before)

Example 37 with SimpleFilterProvider

use of com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider in project gravitee-management-rest-api by gravitee-io.

the class ApiService_FindByUserTest method setUp.

@Before
public void setUp() {
    PropertyFilter apiMembershipTypeFilter = new ApiPermissionFilter();
    objectMapper.setFilterProvider(new SimpleFilterProvider(Collections.singletonMap("apiMembershipTypeFilter", apiMembershipTypeFilter)));
}
Also used : SimpleFilterProvider(com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider) PropertyFilter(com.fasterxml.jackson.databind.ser.PropertyFilter) ApiPermissionFilter(io.gravitee.management.service.jackson.filter.ApiPermissionFilter) Before(org.junit.Before)

Example 38 with SimpleFilterProvider

use of com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider in project gravitee-management-rest-api by gravitee-io.

the class ApiService_StopTest method setUp.

@Before
public void setUp() {
    PropertyFilter apiMembershipTypeFilter = new ApiPermissionFilter();
    objectMapper.setFilterProvider(new SimpleFilterProvider(Collections.singletonMap("apiMembershipTypeFilter", apiMembershipTypeFilter)));
}
Also used : SimpleFilterProvider(com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider) PropertyFilter(com.fasterxml.jackson.databind.ser.PropertyFilter) ApiPermissionFilter(io.gravitee.management.service.jackson.filter.ApiPermissionFilter) Before(org.junit.Before)

Example 39 with SimpleFilterProvider

use of com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider in project candlepin by candlepin.

the class ProductDataTest method createObjects.

@Before
public void createObjects() {
    this.mapper = new ObjectMapper();
    SimpleFilterProvider filterProvider = new SimpleFilterProvider();
    filterProvider.setDefaultFilter(new DynamicPropertyFilter());
    this.mapper.setFilters(filterProvider);
}
Also used : SimpleFilterProvider(com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider) DynamicPropertyFilter(org.candlepin.common.jackson.DynamicPropertyFilter) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Before(org.junit.Before)

Example 40 with SimpleFilterProvider

use of com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider in project candlepin by candlepin.

the class PoolTest method createObjects.

@Before
public void createObjects() {
    this.mapper = new ObjectMapper();
    SimpleFilterProvider filterProvider = new SimpleFilterProvider();
    filterProvider = filterProvider.addFilter("PoolFilter", new PoolEventFilter());
    filterProvider = filterProvider.addFilter("OwnerFilter", new HateoasBeanPropertyFilter());
    filterProvider.setDefaultFilter(new DynamicPropertyFilter());
    this.mapper.setFilters(filterProvider);
    beginTransaction();
    try {
        owner = new Owner("testowner");
        ownerCurator.create(owner);
        prod1 = this.createProduct(owner);
        prod2 = this.createProduct(owner);
        Set<Product> providedProducts = new HashSet<>();
        providedProducts.add(prod2);
        pool = TestUtil.createPool(owner, prod1, providedProducts, 1000);
        subscription = TestUtil.createSubscription(owner, prod1);
        subscription.setId(Util.generateDbUUID());
        pool.setSourceSubscription(new SourceSubscription(subscription.getId(), "master"));
        poolCurator.create(pool);
        owner = pool.getOwner();
        consumer = this.createConsumer(owner);
        productCurator.create(prod1);
        poolCurator.create(pool);
        commitTransaction();
    } catch (RuntimeException e) {
        rollbackTransaction();
        throw e;
    }
}
Also used : SimpleFilterProvider(com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider) HateoasBeanPropertyFilter(org.candlepin.common.jackson.HateoasBeanPropertyFilter) DynamicPropertyFilter(org.candlepin.common.jackson.DynamicPropertyFilter) PoolEventFilter(org.candlepin.jackson.PoolEventFilter) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) HashSet(java.util.HashSet) Before(org.junit.Before)

Aggregations

SimpleFilterProvider (com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider)51 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)21 FilterProvider (com.fasterxml.jackson.databind.ser.FilterProvider)17 PropertyFilter (com.fasterxml.jackson.databind.ser.PropertyFilter)12 SimpleBeanPropertyFilter (com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter)11 Test (org.junit.Test)10 ApiPermissionFilter (io.gravitee.management.service.jackson.filter.ApiPermissionFilter)9 Before (org.junit.Before)9 Test (org.junit.jupiter.api.Test)7 ObjectWriter (com.fasterxml.jackson.databind.ObjectWriter)6 JsonGenerator (com.fasterxml.jackson.core.JsonGenerator)4 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)4 HashSet (java.util.HashSet)4 JsonGenerationException (com.fasterxml.jackson.core.JsonGenerationException)3 JacksonAnnotationIntrospector (com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector)3 lombok.val (lombok.val)3 Log4jLogEvent (org.apache.logging.log4j.core.impl.Log4jLogEvent)3 AuthenticationProperties (org.apereo.cas.configuration.model.core.authentication.AuthenticationProperties)3 LdapAuthenticationProperties (org.apereo.cas.configuration.model.support.ldap.LdapAuthenticationProperties)3 Matchers.containsString (org.hamcrest.Matchers.containsString)3