@Test
public void testApply() {

	when(
		_language.getLanguageId(new Locale("pt", "BR"))
	).thenReturn(
		"pt_BR"
	);
	JSONObject jsonObject = _jsonFactory.createJSONObject();
	JSONArray jsonArray = _jsonFactory.createJSONArray();
	jsonArray.put(
		_createJSONObject("label1", "value1")
	).put(
		_createJSONObject("label2", "value2")
	).put(
		_createJSONObject("label3", "value3")
	);
	jsonObject.put("pt_BR", jsonArray);
	String json = jsonObject.toJSONString();
	DefaultDDMExpressionObserver defaultDDMExpressionObserver =
		new DefaultDDMExpressionObserver();
	DefaultDDMExpressionObserver spy = spy(defaultDDMExpressionObserver);
	_setOptionsFunction.setDDMExpressionObserver(spy);
	_setOptionsFunction.setDDMExpressionParameterAccessor(
		new DefaultDDMExpressionParameterAccessor());
	Boolean result = _setOptionsFunction.apply("optionList", json);
	ArgumentCaptor<UpdateFieldPropertyRequest> argumentCaptor =
		ArgumentCaptor.forClass(UpdateFieldPropertyRequest.class);
	Mockito.verify(
		spy, Mockito.times(1)
	).updateFieldProperty(
		argumentCaptor.capture()
	);
	UpdateFieldPropertyRequest updateFieldPropertyRequest =
		argumentCaptor.getValue();
	Assert.assertEquals(
		"optionList", updateFieldPropertyRequest.getField());
	Map<String, Object> properties =
		updateFieldPropertyRequest.getProperties();
	Assert.assertTrue(properties.containsKey("options"));
	List<KeyValuePair> keyValuePairs = new ArrayList<KeyValuePair>() {
		{
			add(new KeyValuePair("value1", "label1"));
			add(new KeyValuePair("value2", "label2"));
			add(new KeyValuePair("value3", "label3"));
		}
	};
	Assert.assertEquals(keyValuePairs, properties.get("options"));
	Assert.assertTrue(result);
}