@Test(expected = ProviderFactoryException.class)
public void testGetFlowProviderBeforeInitializingShouldThrowException() {

    final NiFiRegistryProperties props = new NiFiRegistryProperties();
    props.setProperty(NiFiRegistryProperties.PROVIDERS_CONFIGURATION_FILE, "src/test/resources/provider/providers-good.xml");
    final ExtensionManager extensionManager = Mockito.mock(ExtensionManager.class);
    when(extensionManager.getExtensionClassLoader(any(String.class)))
            .thenReturn(new ExtensionClassLoader("/tmp", new URL[0],this.getClass().getClassLoader()));
    final DataSource dataSource = Mockito.mock(DataSource.class);
    final ProviderFactory providerFactory = new StandardProviderFactory(props, extensionManager, dataSource);
    providerFactory.getFlowPersistenceProvider();
}