### Question:
OnlineBackupExtensionFactory extends KernelExtensionFactory<OnlineBackupExtensionFactory.Dependencies> { @Override public Lifecycle newInstance( KernelContext context, Dependencies dependencies ) { if ( !isCausalClusterInstance( context ) && isDefaultDatabase( dependencies.neoStoreDataSource(), dependencies.getConfig() ) ) { return new OnlineBackupKernelExtension( dependencies.getConfig(), dependencies.getGraphDatabaseAPI(), dependencies.logService().getInternalLogProvider(), dependencies.monitors(), dependencies.neoStoreDataSource(), dependencies.fileSystemAbstraction() ); } return new LifecycleAdapter(); } OnlineBackupExtensionFactory(); @Deprecated Class<OnlineBackupSettings> getSettingsClass(); @Override Lifecycle newInstance( KernelContext context, Dependencies dependencies );  }### Answer:
@Test void doNotCreateExtensionForNonDefaultDatabase() { SimpleKernelContext kernelContext = new SimpleKernelContext( testDirectory.databaseDir(), DatabaseInfo.ENTERPRISE, dependencies ); Lifecycle instance = extensionFactory.newInstance( kernelContext, new TestBackDependencies( "another" ) ); assertThat( instance, not( instanceOf( OnlineBackupKernelExtension.class ) ) ); }
@Test void createExtensionForDefaultDatabase() { SimpleKernelContext kernelContext = new SimpleKernelContext( testDirectory.databaseDir(), DatabaseInfo.ENTERPRISE, dependencies ); Lifecycle instance = extensionFactory.newInstance( kernelContext, new TestBackDependencies( GraphDatabaseSettings.DEFAULT_DATABASE_NAME ) ); assertThat( instance, instanceOf( OnlineBackupKernelExtension.class ) ); }