@Test
public void createFileBasedGeneratorNotSupported() {

    // given
    SingleThreadJsonFactory factory = new SingleThreadJsonFactory();
    expectedException.expect(UnsupportedOperationException.class);
    expectedException.expectMessage("File not supported. Use OutputStream");
    // when
    factory.createGenerator(mock(File.class), JsonEncoding.UTF8);
}