Examples of forInterception()


Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.forInterception()

        final List<Function<List<CompleteBean>, List<CompleteBean>>> entitiesFunctions = isoEntitiesCaptor.getAllValues();

        final List<CompleteBean> entitiesWithTriggers = entitiesFunctions.get(0).apply(asList(entity));
        assertThat(entitiesWithTriggers).containsExactly(entity);
        verify(meta.forInterception()).intercept(entity, Event.POST_LOAD);

        final List<CompleteBean> entitiesWithProxy = entitiesFunctions.get(1).apply(asList(entity));
        assertThat(entitiesWithProxy).containsExactly(entity);
    }
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.forInterception()

        assertThat(actualEntity).isSameAs(entity);

        final List<Function<CompleteBean, CompleteBean>> captured = isoEntityCaptor.getAllValues();
        final CompleteBean applyTriggers = captured.get(0).apply(entity);
        assertThat(applyTriggers).isSameAs(entity);
        verify(meta.forInterception()).intercept(entity, Event.POST_LOAD);

        final CompleteBean proxifiedEntity = captured.get(1).apply(entity);
        assertThat(proxifiedEntity).isSameAs(entity);
    }
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.forInterception()

        for (Interceptor<?> interceptor : interceptors) {
            Class<?> entityClass = propertyParser.inferEntityClassFromInterceptor(interceptor);
            EntityMeta entityMeta = entityMetaMap.get(entityClass);
            Validator.validateBeanMappingTrue(entityMeta != null, "The entity class '%s' is not found",
                    entityClass.getCanonicalName());
            entityMeta.forInterception().addInterceptor(interceptor);
        }
    }
}
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.forInterception()

            public List<T> apply(List<Row> rows) {
                List<T> clusteredEntities = new ArrayList<>();
                for (Row row : rows) {
                    T clusteredEntity = meta.forOperations().instanciate();
                    mapper.setNonCounterPropertiesToEntity(row, meta, clusteredEntity);
                    meta.forInterception().intercept(clusteredEntity, Event.POST_LOAD);
                    clusteredEntities.add(clusteredEntity);
                }
                return clusteredEntities;
            }
        };
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.forInterception()

        // When
        bootstrapper.addInterceptorsToEntityMetas(interceptors, entityMetaMap);

        // Then
        assertThat(metaString.forInterception().getInterceptors()).contains(stringInterceptor1, stringInterceptor2);
        assertThat(metaLong.forInterception().getInterceptors()).contains(longInterceptor);
    }

    private Interceptor<String> stringInterceptor1 = new Interceptor<String>() {
        @Override
        public void onEvent(String entity) {
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.forInterception()

        //When
        context.triggerInterceptor(meta, entity, Event.POST_LOAD);

        //Then
        verify(meta.forInterception()).intercept(entity, Event.POST_LOAD);
    }

    @Test
    public void should_push_interceptor_to_list() throws Exception {
        //Given
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.forInterception()

        //When
        context.triggerInterceptor(meta, entity, Event.POST_INSERT);

        //Then
        verify(meta.forInterception(), never()).intercept(entity, Event.POST_INSERT);
        assertThat(context.eventHolders).hasSize(1);
        final EventHolder eventHolder = context.eventHolders.get(0);
        eventHolder.triggerInterception();
        verify(meta.forInterception()).intercept(entity, Event.POST_INSERT);
    }
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.forInterception()

        //Then
        verify(meta.forInterception(), never()).intercept(entity, Event.POST_INSERT);
        assertThat(context.eventHolders).hasSize(1);
        final EventHolder eventHolder = context.eventHolders.get(0);
        eventHolder.triggerInterception();
        verify(meta.forInterception()).intercept(entity, Event.POST_INSERT);
    }

    @Test
    public void should_duplicate_with_no_data_but_consistency() throws Exception {
        //Given
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.holder.EntityMeta.forInterception()

        //When
        context.triggerInterceptor(meta, entity, Event.POST_INSERT);

        //Then
        verify(meta.forInterception()).intercept(entity, Event.POST_INSERT);

    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.