Search in sources :

Example 1 with PoolEventFilter

use of org.candlepin.jackson.PoolEventFilter 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

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 SimpleFilterProvider (com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider)1 HashSet (java.util.HashSet)1 DynamicPropertyFilter (org.candlepin.common.jackson.DynamicPropertyFilter)1 HateoasBeanPropertyFilter (org.candlepin.common.jackson.HateoasBeanPropertyFilter)1 PoolEventFilter (org.candlepin.jackson.PoolEventFilter)1 Before (org.junit.Before)1