class SolrOperationsService {

    public void createCore(StratioStreamingMessage message) throws IOException, URISyntaxException, SolrServerException, ParserConfigurationException, SAXException, TransformerException, InterruptedException {
        String core = message.getStreamName();
        String dataPath = this.dataDir + '/' + core + "/data";
        String confPath = this.dataDir + '/' + core + "/conf";
        createDirs(dataPath, confPath);
        createSolrConfig(confPath);
        createSolrSchema(message.getColumns(), confPath);
        SolrClient solrClient = getSolrclient(core);
        CoreAdminRequest.Create createCore = new CoreAdminRequest.Create();
        createCore.setDataDir(dataPath);
        createCore.setInstanceDir(dataDir + '/' + core);
        createCore.setCoreName(core);
        createCore.setSchemaName("schema.xml");
        createCore.setConfigName("solrconfig.xml");
        if (solrClient instanceof CloudSolrClient) {
            ((CloudSolrClient)solrClient).uploadConfig(Paths.get(confPath), core);
        }
        solrClient.request(createCore);
    }

}

class SolrOperationsServiceTest {

    private static final Logger LOGGER;
    private SolrOperationsService service;
    private static final String HOSTS;
    private static final Boolean IS_CLOUD;
    @Rule
    public TemporaryFolder DATA_FOLDER;
    @Rule
    public TemporaryFolder CONF_FOLDER;

    @Test
    @Ignore
    public void testCreateCore() throws Exception {


        StratioStreamingMessage message= new StratioStreamingMessage(
                    StreamsHelper.STREAM_NAME, Long.parseLong("1234567890"), StreamsHelper.COLUMNS);
            service.createCore(message);
    }

}