public class TestJsonFormatDetection extends com.fasterxml.jackson.core.BaseTest
{
public void testSimpleValidArray() throws Exception
{
JsonFactory jsonF = new JsonFactory();
DataFormatDetector detector = new DataFormatDetector(jsonF);
final String ARRAY_JSON = "[ 1, 2 ]";
DataFormatMatcher matcher = detector.findFormat(new ByteArrayInputStream(ARRAY_JSON.getBytes("UTF-8")));
// should have match
assertTrue(matcher.hasMatch());
assertEquals("JSON", matcher.getMatchedFormatName());
assertSame(jsonF, matcher.getMatch());
// no "certain" match with JSON, but solid: