@Test
public void testGetFieldValueNameJSONObjectWithExistingSegmentsFieldCustomizer() {

	String entityName = RandomTestUtil.randomString();
	String fieldName = RandomTestUtil.randomString();
	String fieldValue = RandomTestUtil.randomString();
	String fieldValueName = RandomTestUtil.randomString();
	Locale locale = LocaleUtil.getDefault();
	Mockito.doReturn(
		Optional.of(
			_createSegmentsFieldCustomizer(
				fieldValue, fieldValueName, locale))
	).when(
		_segmentsFieldCustomizerRegistry
	).getSegmentsFieldCustomizerOptional(
		entityName, fieldName
	);
	JSONObject jsonObject =
		_getSegmentsFieldValueNameMVCResourceCommand.
			getFieldValueNameJSONObject(
				entityName, fieldName, fieldValue, locale);
	JSONObject expectedJSONObject = JSONUtil.put(
		"fieldValueName", fieldValueName);
	Assert.assertEquals(
		expectedJSONObject.toJSONString(), jsonObject.toJSONString());
}