Mockito.when(evaluatorProvider.getLanguage()).thenReturn(language);
Mockito.when(mockData.getLanguage()).thenReturn(language);
Mockito.when(evaluatorProvider.compile(Mockito.anyString())).thenReturn(new ReturnExecutor());
new EvaluatorProviderRegistry().addProvider(evaluatorProvider);
final Executor executor =
EvaluatorProviderRegistry.getExecutor(EvaluatorComponent.class.cast(parentComponent));
final Evaluator e = new Evaluator() {
@Override
public String getCode() {
return "test";
}
@Override
public String getDisplayName() {
return "testName";
}
@Override
public String getLanguage() {
return language;
}
public boolean requiresMultipleInputs() {
return false;
}
@Override
public FeedProvider.RenderingInfo evaluate(Map<String, List<Map<String, String>>> data,
List<FeedProvider> providers) {
return executor.evaluate(data, providers);
}
};
final Evaluator e2 = new Evaluator() {
@Override
public String getCode() {
return "test2";
}
@Override
public String getDisplayName() {
return "testName2";
}
@Override
public String getLanguage() {
return language;
}
public boolean requiresMultipleInputs() {
return false;
}
@Override
public FeedProvider.RenderingInfo evaluate(Map<String, List<Map<String, String>>> data,
List<FeedProvider> providers) {
return executor.evaluate(data, providers);
}
};
eList = new ArrayList<Evaluator>();