RyaSinkTask extends SinkTask { @Override public void start(final Map<String, String> props) throws ConnectException { requireNonNull(props); checkRyaInstanceExists(props); final Sail sail = makeSail(props); sailRepo = new SailRepository( sail ); conn = sailRepo.getConnection(); }  @Override String version(); @Override void start(final Map<String, String> props); @Override void put(final Collection<SinkRecord> records); @Override void flush(final Map<TopicPartition, OffsetAndMetadata> currentOffsets); @Override void stop();  }
@Test(expected = IllegalStateException.class) public void start_ryaInstanceDoesNotExist() { final RyaSinkTask task = new RyaSinkTask() { @Override protected void checkRyaInstanceExists(final Map<String, String> taskConfig) throws IllegalStateException { throw new IllegalStateException("It doesn't exist."); } @Override protected Sail makeSail(final Map<String, String> taskConfig) { return null; } }; task.start(new HashMap<>()); }