KiteFromInitializer extends Initializer<LinkConfiguration,
    FromJobConfiguration> { @Override public void initialize(InitializerContext context, LinkConfiguration linkConfig, FromJobConfiguration fromJobConfig) { String uri = ConfigUtil.buildDatasetUri( linkConfig.linkConfig, fromJobConfig.fromJobConfig.uri); LOG.debug("Constructed dataset URI: " + uri); if (!Datasets.exists(uri)) { LOG.error("Dataset does not exist"); throw new SqoopException(KiteConnectorError.GENERIC_KITE_CONNECTOR_0002); } }  @Override void initialize(InitializerContext context,
      LinkConfiguration linkConfig, FromJobConfiguration fromJobConfig); @Override Set<String> getJars(InitializerContext context,
      LinkConfiguration linkConfig, FromJobConfiguration fromJobConfig); @Override Schema getSchema(InitializerContext context,
      LinkConfiguration linkConfig, FromJobConfiguration fromJobConfig);  }
@Test public void testInitializePassed() { FromJobConfiguration jobConfig = new FromJobConfiguration(); jobConfig.fromJobConfig.uri = "dataset:file:/ds/exist"; when(Datasets.exists(jobConfig.fromJobConfig.uri)).thenReturn(true); initializer.initialize(null, new LinkConfiguration(), jobConfig); }
@Test(expectedExceptions = SqoopException.class) public void testInitializeFailed() { FromJobConfiguration jobConfig = new FromJobConfiguration(); jobConfig.fromJobConfig.uri = "dataset:file:/ds/not/exist"; when(Datasets.exists(jobConfig.fromJobConfig.uri)).thenReturn(false); initializer.initialize(null, new LinkConfiguration(), jobConfig); }