### Question:
UserDbUtils { public static DbContext createDbContext(final Path dbPath) { DataSource dataSource = createDataSource(dbPath); DbContext dbContext = new DbContext(); dbContext.setDataSource(dataSource); dbContext.setDatabaseFile(dbPath); return dbContext; } private  UserDbUtils(); static DbContext createDbContext(final Path dbPath); static String createFileName(String username);  }### Answer:
@Test public void testCreateDbContext() throws IOException, SQLException { Path file = null; try { file = Paths.get(FileUtils.getTempDirectoryPath(), "testdb_file.db"); DbContext context = UserDbUtils.createDbContext(file); assertEquals(file, context.getDatabaseFile()); assertNotNull(context.getDataSource()); DatabaseMetaData dmd = context.getDataSource().getConnection().getMetaData(); String url = dmd.getURL(); assertTrue(url.contains(file.toString())); } finally { if (file != null) { Files.deleteIfExists(file); } } }