StreamOperationServiceWithoutMetrics { public List<StratioStreamingMessage> list() { List<StratioStreamingMessage> result = new ArrayList<>(); for (StreamDefinition streamDefinition : siddhiManager.getStreamDefinitions()) { if (suitableToList(streamDefinition.getStreamId())) { StratioStreamingMessage message = new StratioStreamingMessage(); for (Attribute attribute : streamDefinition.getAttributeList()) { message.addColumn(new ColumnNameTypeValue(attribute.getName(), this.getStreamingType(attribute .getType()), null)); } StreamStatusDTO streamStatus = streamStatusDao.get(streamDefinition.getStreamId()); if (streamStatus != null) { Map<String, QueryDTO> attachedQueries = streamStatus.getAddedQueries(); for (Map.Entry<String, QueryDTO> entry : attachedQueries.entrySet()) { message.addQuery(new StreamQuery(entry.getKey(), entry.getValue().getQueryRaw())); } message.setUserDefined(streamStatus.getUserDefined()); message.setActiveActions(streamStatusDao.getEnabledActions(streamDefinition.getStreamId())); } message.setStreamName(streamDefinition.getStreamId()); result.add(message); } } return result; } StreamOperationServiceWithoutMetrics(SiddhiManager siddhiManager, StreamStatusDao streamStatusDao,
                                                CallbackService callbackService);  StreamOperationServiceWithoutMetrics(SiddhiManager siddhiManager, StreamStatusDao streamStatusDao,
            CallbackService callbackService, ConfigurationContext configurationContext);  StreamOperationServiceWithoutMetrics(SiddhiManager siddhiManager, StreamStatusDao streamStatusDao,
        CallbackService callbackService, DroolsConnectionContainer droolsConnectionContainer, ConfigurationContext configurationContext); void createInternalStream(String streamName, List<ColumnNameTypeValue> columns); void createStream(String streamName, List<ColumnNameTypeValue> columns); boolean streamExist(String streamName); boolean isUserDefined(String streamName); int enlargeStream(String streamName, List<ColumnNameTypeValue> columns); int enlargeStream(String streamName, List<ColumnNameTypeValue> columns, Boolean raiseException); void dropStream(String streamName); String addQuery(String streamName, String queryString); void removeQuery(String queryId, String streamName); boolean queryIdExists(String streamName, String queryId); boolean queryRawExists(String streamName, String queryRaw); Boolean columnExists(String streamName, String columnName); void enableAction(String streamName, StreamAction action); void disableAction(String streamName, StreamAction action); boolean isActionEnabled(String streamName, StreamAction action); void enableEngineAction(String streamName, EngineActionType engineActionType, Map<String, Object>
            engineActionParams); void disableEngineAction(String streamName, EngineActionType engineActionType); List<StratioStreamingMessage> list(); void send(String streamName, List<ColumnNameTypeValue> columns);  }
@Test public void testList() throws Exception { streamOperationsService.createStream(StreamsHelper.STREAM_NAME, StreamsHelper.COLUMNS); String queryId= streamOperationsService.addQuery(StreamsHelper.STREAM_NAME, StreamsHelper.QUERY); streamOperationsService.enableAction(StreamsHelper.STREAM_NAME, StreamAction.LISTEN); List<StratioStreamingMessage> list= streamOperationsService.list(); for (StratioStreamingMessage message: list) { if (message.getStreamName().equals(StreamsHelper.STREAM_NAME)) { assertEquals("Expected value not found", 1, message.getQueries().size()); assertEquals("Expected value not found", 6, message.getColumns().size()); } else { assertEquals("Expected value not found", 0, message.getActiveActions().size()); assertEquals("Expected value not found", 3, message.getColumns().size()); } } }