test_class.file: step-controller/step-controller-server/src/test/java/step/plugins/screentemplating/ScreenTemplateManagerTest.java
test_class.identifier: ScreenTemplateManagerTest
test_case.body: @Test
  	public void test() {
  		
  		ScreenInputAccessor a = new ScreenInputAccessor() {
  
  			@Override
  			public List<ScreenInput> getScreenInputsByScreenId(String screenId) {
  				if(screenId.equals("testScreen1")) {
  					List<ScreenInput> result = new ArrayList<>();
  					result.add(new ScreenInput("testScreen1", new Input("Param1")));
  					result.add(new ScreenInput("testScreen1", new Input("Param2", Arrays.asList(new Option[] {new Option("Option1"), new Option("Option2")}))));
  					result.add(new ScreenInput("testScreen1", new Input(InputType.TEXT,"Param3","LabelParam3", Arrays.asList(new Option[] {new Option("Option1"), new Option("Option2"), new Option("Option3","user=='user1'")}))));
  					ScreenInput i = new ScreenInput("testScreen1", new Input(InputType.TEXT,"Param4","LabelParam4", Arrays.asList(new Option[] {new Option("Option1"), new Option("Option2")})));
  					i.getInput().setActivationExpression(new Expression("user=='user1'"));
  					result.add(i);
  					i = new ScreenInput("testScreen1", new Input("Param5", Arrays.asList(new Option[] {new Option("Option1"), new Option("Option2")})));
  					i.getInput().setActivationExpression(new Expression("user=='user1'"));
  					result.add(i);
  					return result;
  				}
  				throw new RuntimeException("Unknown screen "+screenId);
  			}
  
  			@Override
  			public void remove(ObjectId id) {
  			}
  
  			@Override
  			public ScreenInput save(ScreenInput entity) {
  				return null;
  			}
  
  			@Override
  			public void save(Collection<? extends ScreenInput> entities) {
  			}
  
  			@Override
  			public ScreenInput get(ObjectId id) {
  				return null;
  			}
  
  			@Override
  			public ScreenInput findByAttributes(Map<String, String> attributes) {
  				return null;
  			}
  
  			@Override
  			public Iterator<ScreenInput> getAll() {
  				return null;
  			}
  
  			@Override
  			public Spliterator<ScreenInput> findManyByAttributes(Map<String, String> attributes) {
  				return null;
  			}
  
  			@Override
  			public ScreenInput findByAttributes(Map<String, String> attributes, String attributesMapKey) {
  				return null;
  			}
  
  			@Override
  			public Spliterator<ScreenInput> findManyByAttributes(Map<String, String> attributes,
  					String attributesMapKey) {
  				return null;
  			}
  
  			@Override
  			public ScreenInput get(String id) {
  				return get(new ObjectId(id));
  			}
  
  			@Override
  			public List<ScreenInput> getRange(int skip, int limit) {
  				return null;
  			}
  		};
  
  		ScreenTemplateManager s = new ScreenTemplateManager(a, new Configuration());
  		
  		List<Input> inputs = s.getInputsForScreen("testScreen1", new HashMap<String, Object>(), newPredicate());
  		Assert.assertEquals(3, inputs.size());
  		Assert.assertEquals(inputs.get(0), new Input(InputType.TEXT, "Param1", "Param1",null));
  		
  		List<Option> options = getDefaultOptionList();
  		Assert.assertEquals(inputs.get(1), new Input(InputType.DROPDOWN, "Param2", "Param2",options));
  		
  		Assert.assertEquals(inputs.get(2), new Input(InputType.TEXT, "Param3", "LabelParam3",options));
  		
  		HashMap<String, Object> ctx = new HashMap<String, Object>();
  		ctx.put("user", "user1");
  		inputs = s.getInputsForScreen("testScreen1", ctx, newPredicate());
  		Assert.assertEquals(5, inputs.size());
  		Assert.assertEquals(inputs.get(2), new Input(InputType.TEXT, "Param3", "LabelParam3",getOptionListForUser1()));
  		Assert.assertEquals(inputs.get(3), new Input(InputType.TEXT, "Param4", "LabelParam4",options));
  		Assert.assertEquals(inputs.get(4), new Input(InputType.DROPDOWN, "Param5", "Param5",options));
  	}
test_case.class_method_signature: ScreenTemplateManagerTest.test()
test_case.full_signature: @Test public void test()
test_case.identifier: test
test_case.invocations: equals add add asList add asList asList setActivationExpression getInput add asList setActivationExpression getInput add get getInputsForScreen newPredicate assertEquals size assertEquals get getDefaultOptionList assertEquals get assertEquals get put getInputsForScreen newPredicate assertEquals size assertEquals get getOptionListForUser1 assertEquals get assertEquals get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test()
focal_class.declarator: listeners = new ArrayList<>()
focal_class.modifier: protected final
focal_class.original_string: protected final List<ScreenTemplateChangeListener> listeners = new ArrayList<>();
focal_class.type: List<ScreenTemplateChangeListener>
focal_class.var_name: listeners
focal_class.declarator: screenInputAccessor
focal_class.modifier: protected
focal_class.original_string: protected ScreenInputAccessor screenInputAccessor;
focal_class.type: ScreenInputAccessor
focal_class.var_name: screenInputAccessor
focal_class.declarator: defaultScriptEngine
focal_class.modifier: protected
focal_class.original_string: protected String defaultScriptEngine;
focal_class.type: String
focal_class.var_name: defaultScriptEngine
focal_class.file: step-controller/step-controller-server/src/main/java/step/plugins/screentemplating/ScreenTemplateManager.java
focal_class.identifier: ScreenTemplateManager
focal_class.class_method_signature: ScreenTemplateManager.ScreenTemplateManager(ScreenInputAccessor screenInputAccessor, Configuration configuration)
focal_class.full_signature: public  ScreenTemplateManager(ScreenInputAccessor screenInputAccessor, Configuration configuration)
focal_class.identifier: ScreenTemplateManager
focal_class.modifiers: public
focal_class.parameters: (ScreenInputAccessor screenInputAccessor, Configuration configuration)
focal_class.signature:  ScreenTemplateManager(ScreenInputAccessor screenInputAccessor, Configuration configuration)
focal_class.class_method_signature: ScreenTemplateManager.getInputsForScreen(String screenId, Map<String,Object> contextBindings, ObjectPredicate objectPredicate)
focal_class.full_signature: public List<Input> getInputsForScreen(String screenId, Map<String,Object> contextBindings, ObjectPredicate objectPredicate)
focal_class.identifier: getInputsForScreen
focal_class.modifiers: public
focal_class.parameters: (String screenId, Map<String,Object> contextBindings, ObjectPredicate objectPredicate)
focal_class.return: List<Input>
focal_class.signature: List<Input> getInputsForScreen(String screenId, Map<String,Object> contextBindings, ObjectPredicate objectPredicate)
focal_class.class_method_signature: ScreenTemplateManager.moveInput(String inputId, int offset)
focal_class.full_signature: public void moveInput(String inputId, int offset)
focal_class.identifier: moveInput
focal_class.modifiers: public
focal_class.parameters: (String inputId, int offset)
focal_class.return: void
focal_class.signature: void moveInput(String inputId, int offset)
focal_class.class_method_signature: ScreenTemplateManager.registerListener(ScreenTemplateChangeListener listener)
focal_class.full_signature: public void registerListener(ScreenTemplateChangeListener listener)
focal_class.identifier: registerListener
focal_class.modifiers: public
focal_class.parameters: (ScreenTemplateChangeListener listener)
focal_class.return: void
focal_class.signature: void registerListener(ScreenTemplateChangeListener listener)
focal_class.class_method_signature: ScreenTemplateManager.notifyChange()
focal_class.full_signature: public void notifyChange()
focal_class.identifier: notifyChange
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void notifyChange()
focal_method.body: public List<Input> getInputsForScreen(String screenId, Map<String,Object> contextBindings, ObjectPredicate objectPredicate) {
  		Stream<ScreenInput> stream = screenInputAccessor.getScreenInputsByScreenId(screenId).stream();
  		if(objectPredicate != null) {
  			stream = stream.filter(objectPredicate);
  		}
  		List<Input> screenInputs = stream.map(i->i.getInput()).collect(Collectors.toList());
  		
  		List<Input> result = new ArrayList<>();
  		List<Input> inputs =  Activator.findAllMatches(contextBindings, screenInputs, defaultScriptEngine);
  		for(Input input:inputs) {
  			List<Option> options = input.getOptions();
  			List<Option> activeOptions = null;
  			if(options!=null) {
  				activeOptions = Activator.findAllMatches(contextBindings, options, defaultScriptEngine);
  			}
  			Input clone = new Input(input.getType(), input.getId(), input.getLabel(), input.getDescription(), activeOptions);
  			clone.setValueHtmlTemplate(input.getValueHtmlTemplate());
  			clone.setSearchMapperService(input.getSearchMapperService());
  			result.add(clone);
  		}
  		
  		return result;
  	}
focal_method.class_method_signature: ScreenTemplateManager.getInputsForScreen(String screenId, Map<String,Object> contextBindings, ObjectPredicate objectPredicate)
focal_method.full_signature: public List<Input> getInputsForScreen(String screenId, Map<String,Object> contextBindings, ObjectPredicate objectPredicate)
focal_method.identifier: getInputsForScreen
focal_method.invocations: stream getScreenInputsByScreenId filter collect map getInput toList findAllMatches getOptions findAllMatches getType getId getLabel getDescription setValueHtmlTemplate getValueHtmlTemplate setSearchMapperService getSearchMapperService add
focal_method.modifiers: public
focal_method.parameters: (String screenId, Map<String,Object> contextBindings, ObjectPredicate objectPredicate)
focal_method.return: List<Input>
focal_method.signature: List<Input> getInputsForScreen(String screenId, Map<String,Object> contextBindings, ObjectPredicate objectPredicate)