ValidationFactory { public TypeReport validateBundle( ObjectBundle bundle, Class<? extends IdentifiableObject> klass, List<IdentifiableObject> persistedObjects, List<IdentifiableObject> nonPersistedObjects ) { ValidationContext ctx = getContext(); TypeReport typeReport = new ValidationRunner( validatorMap.get( bundle.getImportMode() ) ) .executeValidationChain( bundle, klass, persistedObjects, nonPersistedObjects, ctx ); removeFromBundle( klass, ctx, bundle ); return addStatistics( typeReport, bundle, persistedObjects, nonPersistedObjects ); } ValidationFactory( SchemaValidator schemaValidator, SchemaService schemaService, AclService aclService,
        UserService userService, List<ObjectBundleHook> objectBundleHooks,
        Map<ImportStrategy, List<Class<? extends ValidationCheck>>> validatorMap ); TypeReport validateBundle( ObjectBundle bundle, Class<? extends IdentifiableObject> klass,
        List<IdentifiableObject> persistedObjects, List<IdentifiableObject> nonPersistedObjects );  }
@Test public void verifyValidationFactoryProcessValidationCheck() { ObjectBundle bundle = createObjectBundle(); TypeReport typeReport = validationFactory.validateBundle( bundle, Attribute.class, bundle.getObjects( Attribute.class, true ), bundle.getObjects( Attribute.class, false ) ); assertThat( bundle.getObjects( Attribute.class, false ), hasSize( 0 ) ); assertThat( bundle.getObjects( Attribute.class, true ), hasSize( 0 ) ); assertThat( typeReport.getStats().getCreated(), is( 0 ) ); assertThat( typeReport.getStats().getUpdated(), is( 0 ) ); assertThat( typeReport.getStats().getDeleted(), is( 0 ) ); assertThat( typeReport.getStats().getIgnored(), is( 1 ) ); assertThat( typeReport.getObjectReports(), hasSize( 1 ) ); }