### Question:
TimeBasedRunPolicy implements TableRepairPolicy, RunPolicy, Closeable { public static Builder builder() { return new Builder(); } TimeBasedRunPolicy(Builder builder); @Override long validate(ScheduledJob job); @Override boolean shouldRun(TableReference tableReference); @Override void close(); static Builder builder();  }### Answer:
@Test public void testBuildWithoutAllTablesCausesIllegalStateException() { mySession.execute(String.format("DROP TABLE %s.%s", myKeyspaceName, TABLE_REJECT_CONFIGURATION)); assertThatExceptionOfType(IllegalStateException.class) .isThrownBy(() -> TimeBasedRunPolicy.builder() .withSession(getNativeConnectionProvider().getSession()) .withStatementDecorator(s -> s) .withKeyspaceName(myKeyspaceName) .build()); mySession.execute(String.format("CREATE TABLE IF NOT EXISTS %s.%s (keyspace_name text, table_name text, start_hour int, start_minute int, end_hour int, end_minute int, PRIMARY KEY(keyspace_name, table_name, start_hour, start_minute))", myKeyspaceName, TABLE_REJECT_CONFIGURATION)); }
@Test public void testActivateWithoutCassandraCausesNoHostAvailableException() { Session session = mock(Session.class); Cluster cluster = mock(Cluster.class); doThrow(NoHostAvailableException.class).when(cluster).getMetadata(); doReturn(cluster).when(session).getCluster(); assertThatExceptionOfType(NoHostAvailableException.class) .isThrownBy(() -> TimeBasedRunPolicy.builder() .withSession(session) .withStatementDecorator(s -> s) .build()); }