### Question:
JdbcResourceMirror extends ResourceMirror { @Override public void prepare(GateScript script) throws IOException { if (script == null) { throw new IllegalArgumentException("script must not be null"); } LOG.debug("Preparing JDBC resource: {}", getName()); for (ProcessScript<?> process : script.getProcesses()) { if (process.getSourceScript().getResourceName().equals(getName())) { JdbcResourceUtil.convert(profile, process, arguments, DriverScript.Kind.SOURCE); ProcessUtil.newDataModel(profile.getResourceName(), process); } if (process.getDrainScript().getResourceName().equals(getName())) { JdbcResourceUtil.convert(profile, process, arguments, DriverScript.Kind.DRAIN); } } } JdbcResourceMirror(JdbcProfile profile, ParameterList arguments); @Override String getName(); @Override void prepare(GateScript script); @Override SourceDriver<T> createSource(ProcessScript<T> script); @Override DrainDriver<T> createDrain(ProcessScript<T> script); @Override void close();  }### Answer:
@Test public void invalid_support_missing() throws Exception { Map<String, String> conf = new HashMap<>(); conf.put(JdbcProcess.TABLE.key(), "PAIR"); conf.put(JdbcProcess.COLUMNS.key(), "KEY,VALUE"); ProcessScript<Pair> process = process(new DriverScript("jdbc", conf), dummy()); GateScript script = script(process); try (JdbcResourceMirror resource = new JdbcResourceMirror(profile(), new ParameterList())) { try { resource.prepare(script); fail(); } catch (IOException e) { } } }
@Test public void invalid_support_unknown() throws Exception { Map<String, String> conf = new HashMap<>(); conf.put(JdbcProcess.TABLE.key(), "PAIR"); conf.put(JdbcProcess.COLUMNS.key(), "KEY,VALUE"); conf.put(JdbcProcess.JDBC_SUPPORT.key(), "__INVALID"); ProcessScript<Pair> process = process(new DriverScript("jdbc", conf), dummy()); GateScript script = script(process); try (JdbcResourceMirror resource = new JdbcResourceMirror(profile(), new ParameterList())) { try { resource.prepare(script); fail(); } catch (IOException e) { } } }