@Test
public void testItemSelectorURLWithFileItemSelectorCriterion()
	throws Exception {

	PortletURL itemSelectorPortletURL = mock(PortletURL.class);
	when(
		itemSelectorPortletURL.toString()
	).thenReturn(
		"itemSelectorPortletURL"
	);
	when(
		_itemSelector.getItemSelectorURL(
			Mockito.any(RequestBackedPortletURLFactory.class),
			Mockito.anyString(), Mockito.any(ItemSelectorCriterion.class))
	).thenReturn(
		itemSelectorPortletURL
	);
	when(
		_itemSelector.getItemSelectedEventName(Mockito.anyString())
	).thenReturn(
		"selectedEventName"
	);
	when(
		_itemSelector.getItemSelectorCriteria(
			"fileItemSelectorCriterionFileEntryItemSelectorReturnType")
	).thenReturn(
		_getFileItemSelectorCriterionFileEntryItemSelectorReturnType()
	);
	JSONObject originalJSONObject = JSONUtil.put(
		"filebrowserImageBrowseLinkUrl",
		"fileItemSelectorCriterionFileEntryItemSelectorReturnType");
	JSONObject jsonObject = JSONFactoryUtil.createJSONObject(
		originalJSONObject.toJSONString());
	AMJournalEditorConfigContributor amJournalEditorConfigContributor =
		new AMJournalEditorConfigContributor();
	ReflectionTestUtil.setFieldValue(
		amJournalEditorConfigContributor, "_itemSelector", _itemSelector);
	amJournalEditorConfigContributor.populateConfigJSONObject(
		jsonObject, _inputEditorTaglibAttributes, _themeDisplay,
		_requestBackedPortletURLFactory);
	Mockito.verify(
		_itemSelector
	).getItemSelectorURL(
		Mockito.any(RequestBackedPortletURLFactory.class),
		Mockito.anyString(), Mockito.any(ItemSelectorCriterion.class)
	);
}