### Question:
DbImportTask extends BaseCayenneTask { @TaskAction public void runImport() { dataSource.validate(); final Injector injector = DIBootstrap.createInjector(new DbSyncModule(), new ToolsModule(getLogger()), new DbImportModule(), binder -> binder.bind(ClassLoaderManager.class).toInstance(new GradlePluginClassLoaderManager(getProject()))); final DbImportConfiguration config = createConfig(); DataSourceFactory dataSourceFactory = injector.getInstance(DataSourceFactory.class); DbAdapterFactory dbAdapterFactory = injector.getInstance(DbAdapterFactory.class); DataNodeDescriptor dataNodeDescriptor = config.createDataNodeDescriptor(); try { DataSource dataSource = dataSourceFactory.getDataSource(dataNodeDescriptor); DbAdapter dbAdapter = dbAdapterFactory.createAdapter(dataNodeDescriptor, dataSource); config.setFiltersConfig(new FiltersConfigBuilder(reverseEngineering) .dataSource(dataSource) .dbAdapter(dbAdapter) .build()); } catch (Exception e) { throw new TaskExecutionException(this, e); } final DbImportConfigurationValidator validator = new DbImportConfigurationValidator(reverseEngineering, config, injector); try { validator.validate(); } catch (Exception ex) { throw new TaskExecutionException(this, ex); } try { injector.getInstance(DbImportAction.class).execute(config); } catch (Exception ex) { final Throwable th = Util.unwindException(ex); String message = "Error importing database schema"; if (th.getLocalizedMessage() != null) { message += ": " + th.getLocalizedMessage(); } getLogger().error(message); throw new TaskExecutionException(this, th); } } DbImportTask(); @TaskAction void runImport(); @OutputFile File getDataMapFile(); void dbImport(final Closure<?> closure); void dbimport(final Closure<?> closure); void dataSource(final Closure<?> closure); DataSourceConfig getDataSource(); DbImportConfig getConfig(); String getAdapter(); void setAdapter(final String adapter); void adapter(final String adapter); @OutputFile @Optional File getCayenneProject(); void setCayenneProject(final File cayenneProject); void cayenneProject(final File cayenneProject); void cayenneProject(final String cayenneProjectFileName);  }### Answer:
@Test(expected = InvalidUserDataException.class) public void testRunWithNoConfig() { task.runImport(); }