ExternalComponentLoaderImpl implements ExternalComponentLoader { @PostConstruct public void init() { gson = new Gson(); isExternalComponentEnabled = Boolean.parseBoolean(System.getProperty(EXTERNAL_COMP_ENABLE_PROP, Boolean.FALSE.toString())); externalComponentsDir = System.getProperty(EXTERNAL_COMP_DIR_PROP, DEFAULT_COMPONENTS_PATH); if (isExternalComponentEnabled) { Path baseDirPath = Paths.get(externalComponentsDir); if (!baseDirPath.toFile().exists()) { baseDirPath.toFile().mkdirs(); } } }  @PostConstruct void init(); @Override List<ExternalComponent> load(); @Override String getExternalComponentsDir(); boolean isEnabled(); static final String EXTERNAL_COMP_DIR_PROP; static final String EXTERNAL_COMP_ENABLE_PROP; static final String DESCRIPTOR_FILE; }
@Test public void testBaseDirCreated() { assertFalse(Files.exists(componentPath)); externalComponentLoaderImpl.init(); assertTrue(Files.exists(componentPath)); }