@SuppressWarnings({ "rawtypes", "unchecked" }) @Test public void testPrivateOnly() { when(deltaEntityIterator.hasNext()).thenReturn(true, true, false); when(deltaEntityIterator.next()).thenReturn(buildUpdatePrivateRecord(), buildDeleteRecord()); extractor.execute("Midgar", null, new DateTime()); verify(entityExtractor, times(1)).write(any(Entity.class), any(ExtractFile.class), any(EntityExtractor.CollectionWrittenRecord.class), (Predicate) Mockito.isNull()); verify(entityWriteManager, times(8)).writeDeleteFile(any(Entity.class), any(ExtractFile.class)); }
public void execute(String tenant, File tenantDirectory, DateTime deltaUptoTime) { TenantContext.setTenantId(tenant); audit(securityEventUtil.createSecurityEvent(this.getClass().getName(), "Delta Extract Initiation", LogLevelType.TYPE_INFO, BEMessageCode.BE_SE_CODE_0019, DATE_TIME_FORMATTER.print(deltaUptoTime))); Map<String, Set<String>> appsPerEdOrg = appsPerEdOrg(); ExtractFile publicDeltaExtractFile = createPublicExtractFile(tenantDirectory, deltaUptoTime); deltaEntityIterator.init(tenant, deltaUptoTime); while (deltaEntityIterator.hasNext()) { DeltaRecord delta = deltaEntityIterator.next(); if (delta.getOp() == Operation.UPDATE) { extractUpdate(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } else if (delta.getOp() == Operation.DELETE) { extractDelete(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } else if (delta.getOp() == Operation.PURGE) { extractPurge(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } } logEntityCounts(); audit(securityEventUtil.createSecurityEvent(this.getClass().getName(), "Delta Extract Finished", LogLevelType.TYPE_INFO, BEMessageCode.BE_SE_CODE_0021, DATE_TIME_FORMATTER.print(deltaUptoTime))); finalizeExtraction(tenant, deltaUptoTime); }
DeltaExtractor implements InitializingBean { public void execute(String tenant, File tenantDirectory, DateTime deltaUptoTime) { TenantContext.setTenantId(tenant); audit(securityEventUtil.createSecurityEvent(this.getClass().getName(), "Delta Extract Initiation", LogLevelType.TYPE_INFO, BEMessageCode.BE_SE_CODE_0019, DATE_TIME_FORMATTER.print(deltaUptoTime))); Map<String, Set<String>> appsPerEdOrg = appsPerEdOrg(); ExtractFile publicDeltaExtractFile = createPublicExtractFile(tenantDirectory, deltaUptoTime); deltaEntityIterator.init(tenant, deltaUptoTime); while (deltaEntityIterator.hasNext()) { DeltaRecord delta = deltaEntityIterator.next(); if (delta.getOp() == Operation.UPDATE) { extractUpdate(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } else if (delta.getOp() == Operation.DELETE) { extractDelete(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } else if (delta.getOp() == Operation.PURGE) { extractPurge(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } } logEntityCounts(); audit(securityEventUtil.createSecurityEvent(this.getClass().getName(), "Delta Extract Finished", LogLevelType.TYPE_INFO, BEMessageCode.BE_SE_CODE_0021, DATE_TIME_FORMATTER.print(deltaUptoTime))); finalizeExtraction(tenant, deltaUptoTime); } }
DeltaExtractor implements InitializingBean { public void execute(String tenant, File tenantDirectory, DateTime deltaUptoTime) { TenantContext.setTenantId(tenant); audit(securityEventUtil.createSecurityEvent(this.getClass().getName(), "Delta Extract Initiation", LogLevelType.TYPE_INFO, BEMessageCode.BE_SE_CODE_0019, DATE_TIME_FORMATTER.print(deltaUptoTime))); Map<String, Set<String>> appsPerEdOrg = appsPerEdOrg(); ExtractFile publicDeltaExtractFile = createPublicExtractFile(tenantDirectory, deltaUptoTime); deltaEntityIterator.init(tenant, deltaUptoTime); while (deltaEntityIterator.hasNext()) { DeltaRecord delta = deltaEntityIterator.next(); if (delta.getOp() == Operation.UPDATE) { extractUpdate(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } else if (delta.getOp() == Operation.DELETE) { extractDelete(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } else if (delta.getOp() == Operation.PURGE) { extractPurge(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } } logEntityCounts(); audit(securityEventUtil.createSecurityEvent(this.getClass().getName(), "Delta Extract Finished", LogLevelType.TYPE_INFO, BEMessageCode.BE_SE_CODE_0021, DATE_TIME_FORMATTER.print(deltaUptoTime))); finalizeExtraction(tenant, deltaUptoTime); }  }
DeltaExtractor implements InitializingBean { public void execute(String tenant, File tenantDirectory, DateTime deltaUptoTime) { TenantContext.setTenantId(tenant); audit(securityEventUtil.createSecurityEvent(this.getClass().getName(), "Delta Extract Initiation", LogLevelType.TYPE_INFO, BEMessageCode.BE_SE_CODE_0019, DATE_TIME_FORMATTER.print(deltaUptoTime))); Map<String, Set<String>> appsPerEdOrg = appsPerEdOrg(); ExtractFile publicDeltaExtractFile = createPublicExtractFile(tenantDirectory, deltaUptoTime); deltaEntityIterator.init(tenant, deltaUptoTime); while (deltaEntityIterator.hasNext()) { DeltaRecord delta = deltaEntityIterator.next(); if (delta.getOp() == Operation.UPDATE) { extractUpdate(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } else if (delta.getOp() == Operation.DELETE) { extractDelete(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } else if (delta.getOp() == Operation.PURGE) { extractPurge(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } } logEntityCounts(); audit(securityEventUtil.createSecurityEvent(this.getClass().getName(), "Delta Extract Finished", LogLevelType.TYPE_INFO, BEMessageCode.BE_SE_CODE_0021, DATE_TIME_FORMATTER.print(deltaUptoTime))); finalizeExtraction(tenant, deltaUptoTime); }  @Override void afterPropertiesSet(); void execute(String tenant, File tenantDirectory, DateTime deltaUptoTime); void setSecurityEventUtil(SecurityEventUtil securityEventUtil); }
DeltaExtractor implements InitializingBean { public void execute(String tenant, File tenantDirectory, DateTime deltaUptoTime) { TenantContext.setTenantId(tenant); audit(securityEventUtil.createSecurityEvent(this.getClass().getName(), "Delta Extract Initiation", LogLevelType.TYPE_INFO, BEMessageCode.BE_SE_CODE_0019, DATE_TIME_FORMATTER.print(deltaUptoTime))); Map<String, Set<String>> appsPerEdOrg = appsPerEdOrg(); ExtractFile publicDeltaExtractFile = createPublicExtractFile(tenantDirectory, deltaUptoTime); deltaEntityIterator.init(tenant, deltaUptoTime); while (deltaEntityIterator.hasNext()) { DeltaRecord delta = deltaEntityIterator.next(); if (delta.getOp() == Operation.UPDATE) { extractUpdate(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } else if (delta.getOp() == Operation.DELETE) { extractDelete(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } else if (delta.getOp() == Operation.PURGE) { extractPurge(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } } logEntityCounts(); audit(securityEventUtil.createSecurityEvent(this.getClass().getName(), "Delta Extract Finished", LogLevelType.TYPE_INFO, BEMessageCode.BE_SE_CODE_0021, DATE_TIME_FORMATTER.print(deltaUptoTime))); finalizeExtraction(tenant, deltaUptoTime); }  @Override void afterPropertiesSet(); void execute(String tenant, File tenantDirectory, DateTime deltaUptoTime); void setSecurityEventUtil(SecurityEventUtil securityEventUtil); static final DateTimeFormatter DATE_TIME_FORMATTER; static final String DATE_FIELD; static final String TIME_FIELD; }