@Test
public void testFromString() {
String infoString = String.format(FORMAT, INFO, TYPE.toString(), CONTENT_TYPE.toString(),
LABEL, DESCRIPTION, Boolean.toString(IS_TEMPLATE));
DocumentInfo info = new DocumentInfo(infoString);
assertEquals("Info is not expected.", INFO, info.getInfo());
assertEquals("Type is not expected.", TYPE, info.getType());
assertEquals("Content type is not expected.", CONTENT_TYPE, info.getContentType());
assertEquals("Label is not expected.", LABEL, info.getLabel());
assertEquals("Description is not expected.", DESCRIPTION, info.getDescription());
assertEquals("Is template flag is not expected.", IS_TEMPLATE, info.isTemplate());
infoString = String.format(FORMAT, INFO, TYPE.toString(), CONTENT_TYPE.toString(), "",
DESCRIPTION, Boolean.toString(IS_TEMPLATE));
info = new DocumentInfo(infoString);
assertEquals("Info is not expected.", INFO, info.getInfo());
assertEquals("Type is not expected.", TYPE, info.getType());
assertEquals("Content type is not expected.", CONTENT_TYPE, info.getContentType());
assertEquals("Label is not expected.", null, info.getLabel());
assertEquals("Description is not expected.", DESCRIPTION, info.getDescription());
assertEquals("Is template flag is not expected.", IS_TEMPLATE, info.isTemplate());
infoString = String.format(FORMAT, INFO, TYPE.toString(), CONTENT_TYPE.toString(), "", "",
Boolean.toString(IS_TEMPLATE));
info = new DocumentInfo(infoString);
assertEquals("Info is not expected.", INFO, info.getInfo());
assertEquals("Type is not expected.", TYPE, info.getType());
assertEquals("Content type is not expected.", CONTENT_TYPE, info.getContentType());
assertEquals("Label is not expected.", null, info.getLabel());
assertEquals("Description is not expected.", null, info.getDescription());
assertEquals("Is template flag is not expected.", IS_TEMPLATE, info.isTemplate());
}