### Question:
SqliteLoader implements StoreLoader { @Override public void load(final Path input) throws SQLException { final String url = "jdbc:sqlite:" + input.toString(); this.connection = DriverManager.getConnection(url); this.statement = this.connection.createStatement(); this.results = this.statement.executeQuery(SELECT_QUERY); }  @Override void load(final Path input); @Override DataEntry nextEntry();  }### Answer:
@Test public void loadOnInvalidFile() throws IOException { final Path randomFile = Files.createTempFile("other", ".txt"); final Throwable throwable = catchThrowable(() -> loader.load(randomFile)); assertThat(throwable) .isNotNull() .isInstanceOf(SQLiteException.class) .hasMessageContaining("[SQLITE_ERROR] SQL error or missing database (no such table: payload)"); }
@Test public void loadOnNonexistentFile() throws IOException { final Path randomFile = Files.createTempFile("other", ".txt").getParent().resolve("unknown"); final Throwable throwable = catchThrowable(() -> loader.load(randomFile)); assertThat(throwable) .isNotNull() .isInstanceOf(SQLiteException.class) .hasMessageContaining("[SQLITE_ERROR] SQL error or missing database (no such table: payload)"); }
@Test public void loadProperDatabaseHasNoError() { final Throwable throwable = catchThrowable(() -> loader.load(dbfilePath)); assertThat(throwable).isNull(); }