private static List<StepInjectionMetaEntry> createInjectionValues( TextFileInputMetaInjection.Entry[] entries) { Map<TextFileInputMetaInjection.Entry, Generator<?>> generators = createGeneratorsMapping(); List<StepInjectionMetaEntry> result = new ArrayList<StepInjectionMetaEntry>(entries.length); for (TextFileInputMetaInjection.Entry entry : entries) { StepInjectionMetaEntry injectionEntry = StepInjectionUtil.getEntry(entry); if (entry.getValueType() != ValueMetaInterface.TYPE_NONE) { injectionEntry.setValue(generators.get(entry).generateValue()); } result.add(injectionEntry); } return result; }
@Test public void topEntriesAreInjected() throws Exception { TextFileInputMetaInjection.Entry[] topEntries = TextFileInputMetaInjection.Entry.getTopEntries(); List<StepInjectionMetaEntry> injectionValues = createInjectionValues(topEntries); TextFileInputMetaInjection injection = new TextFileInputMetaInjection(new TextFileInputMeta()); injection.injectStepMetadataEntries(injectionValues); assertInjected(injection.extractStepMetadataEntries(), injectionValues); }