@Test public void shouldFailToLoadNonExporterClasses() throws IOException { final Class exportedClass = ExporterRepository.class; final File jarFile = jarCreator.create(exportedClass); final ExporterCfg config = new ExporterCfg(); final Map<String, Object> args = new HashMap<>(); config.setClassName(exportedClass.getCanonicalName()); config.setJarPath(jarFile.getAbsolutePath()); config.setArgs(args); assertThatThrownBy(() -> repository.load("exported", config)) .isInstanceOf(ExporterLoadException.class) .hasCauseInstanceOf(ClassCastException.class); }
public ExporterDescriptor load(final String id, final Class<? extends Exporter> exporterClass) throws ExporterLoadException { return load(id, exporterClass, null); }
ExporterRepository { public ExporterDescriptor load(final String id, final Class<? extends Exporter> exporterClass) throws ExporterLoadException { return load(id, exporterClass, null); } }
ExporterRepository { public ExporterDescriptor load(final String id, final Class<? extends Exporter> exporterClass) throws ExporterLoadException { return load(id, exporterClass, null); } ExporterRepository();  ExporterRepository(
      final Map<String, ExporterDescriptor> exporters, final ExporterJarRepository jarRepository); }
ExporterRepository { public ExporterDescriptor load(final String id, final Class<? extends Exporter> exporterClass) throws ExporterLoadException { return load(id, exporterClass, null); } ExporterRepository();  ExporterRepository(
      final Map<String, ExporterDescriptor> exporters, final ExporterJarRepository jarRepository); Map<String, ExporterDescriptor> getExporters(); ExporterDescriptor load(final String id, final Class<? extends Exporter> exporterClass); ExporterDescriptor load(
      final String id,
      final Class<? extends Exporter> exporterClass,
      final Map<String, Object> args); ExporterDescriptor load(final String id, final ExporterCfg config); }
ExporterRepository { public ExporterDescriptor load(final String id, final Class<? extends Exporter> exporterClass) throws ExporterLoadException { return load(id, exporterClass, null); } ExporterRepository();  ExporterRepository(
      final Map<String, ExporterDescriptor> exporters, final ExporterJarRepository jarRepository); Map<String, ExporterDescriptor> getExporters(); ExporterDescriptor load(final String id, final Class<? extends Exporter> exporterClass); ExporterDescriptor load(
      final String id,
      final Class<? extends Exporter> exporterClass,
      final Map<String, Object> args); ExporterDescriptor load(final String id, final ExporterCfg config);  }