}
@Test
public void testParseWithChildren() throws Exception {
CustomFieldOptionJsonParser parser = new CustomFieldOptionJsonParser();
final CustomFieldOption customFieldOption = parser.parse(ResourceUtil
.getJsonObjectFromResource("/json/customFieldOption/valid-with-children.json"));
final CustomFieldOption expected = new CustomFieldOption(10017L,
TestUtil.toUri("http://localhost:2990/jira/rest/api/2/customFieldOption/10017"), "colors",
ImmutableList.of(
new CustomFieldOption(10019L,
TestUtil.toUri("http://localhost:2990/jira/rest/api/2/customFieldOption/10019"), "red",
Collections.<CustomFieldOption>emptyList(), null),
new CustomFieldOption(10020L,
TestUtil.toUri("http://localhost:2990/jira/rest/api/2/customFieldOption/10020"), "blue",
Collections.<CustomFieldOption>emptyList(), null),
new CustomFieldOption(10021L,
TestUtil.toUri("http://localhost:2990/jira/rest/api/2/customFieldOption/10021"), "green",
Collections.<CustomFieldOption>emptyList(), null)
), null);
Assert.assertEquals(expected, customFieldOption);
}