@Test
  public void testStreamDefinitionConversion() throws MalformedStreamDefinitionException {
    StreamDefinition streamDef = new StreamDefinition("stockStream", "1.1.0");
    List<Attribute> meta = new ArrayList<Attribute>(1);
    meta.add(new Attribute("symbol", AttributeType.STRING));
    List<Attribute> payload = new ArrayList<Attribute>(1);
    payload.add(new Attribute("price", AttributeType.DOUBLE));
    streamDef.setMetaData(meta);
    streamDef.setPayloadData(payload);

    org.wso2.siddhi.query.api.definition.StreamDefinition siddhiDefinition = null;
    try {
      siddhiDefinition =
          EventProcessorUtil.convertToSiddhiStreamDefinition(streamDef, "stockStream");
    } catch (EventStreamConfigurationException e) {
      log.error(e);
    }
    Assert.assertEquals(siddhiDefinition.getAttributeList().size(), 2);
    log.info(siddhiDefinition);

    /*
            StreamDefinition databrigeDefinition = EventProcessorUtil.convertToDatabridgeStreamDefinition(siddhiDefinition, "stockStream/1.1.0");
            Assert.assertEquals(databrigeDefinition.getPayloadData().size(), 2);
            log.info(databrigeDefinition);
    */
  }
 private static void populateAttributes(
     org.wso2.siddhi.query.api.definition.StreamDefinition streamDefinition,
     List<Attribute> attributes,
     String prefix) {
   if (attributes != null) {
     for (Attribute attribute : attributes) {
       org.wso2.siddhi.query.api.definition.Attribute siddhiAttribute =
           EventProcessorUtil.convertToSiddhiAttribute(attribute, prefix);
       streamDefinition.attribute(siddhiAttribute.getName(), siddhiAttribute.getType());
     }
   }
 }
 public List<StreamDefinition> getSiddhiStreams(
     String[] inputStreamDefinitions, String queryExpressions) throws SiddhiParserException {
   SiddhiManager siddhiManager = createMockSiddhiManager(inputStreamDefinitions, queryExpressions);
   List<org.wso2.siddhi.query.api.definition.StreamDefinition> streamDefinitions =
       siddhiManager.getStreamDefinitions();
   List<StreamDefinition> databridgeStreamDefinitions =
       new ArrayList<StreamDefinition>(streamDefinitions.size());
   for (org.wso2.siddhi.query.api.definition.StreamDefinition siddhiStreamDef :
       streamDefinitions) {
     StreamConfiguration streamConfig = new StreamConfiguration(siddhiStreamDef.getStreamId());
     StreamDefinition databridgeStreamDef =
         EventProcessorUtil.convertToDatabridgeStreamDefinition(siddhiStreamDef, streamConfig);
     databridgeStreamDefinitions.add(databridgeStreamDef);
   }
   siddhiManager.shutdown();
   return databridgeStreamDefinitions;
 }