### Question:
DecisionMetadataEngine extends CommonsMetadataEngine<IStratioStreamingAPI> { @Override @TimerJ protected void alterTable(TableName name, AlterOptions alterOptions, Connection<IStratioStreamingAPI> connection) throws ExecutionValidationException, ExecutionException { if (alterOptions.getOption() == AlterOperation.ADD_COLUMN) { String streamName = StreamUtil.createStreamName(name); com.stratio.decision.commons.constants.ColumnType columnType = convertType(alterOptions .getColumnMetadata().getColumnType()); ColumnNameType column = new ColumnNameType(alterOptions.getColumnMetadata().getName().getName(), columnType); try { connection.getNativeConnection().alterStream(streamName, Arrays.asList(column)); } catch (StratioStreamingException e) { String msg = "Fail altering the Stream [" + streamName + "]. " + e.getMessage(); logger.error(msg); throw new ExecutionException(msg, e); } } else { throw new ExecutionValidationException("Alter table is not supported except for add column"); } } DecisionMetadataEngine(ConnectionHandler connectionHandler);   }### Answer:
@Test public void alterTableAddColumnTest() throws Exception { ColumnMetadata columnMetadata = new ColumnMetadata(new ColumnName(CATALOG, TABLE, COLUM), new Object[0], new ColumnType(DataType.INT)); TableName tableName = new TableName(CATALOG, TABLE); AlterOptions alterOptions = new AlterOptions(AlterOperation.ADD_COLUMN, null, columnMetadata); decisionMetadataEngine.alterTable(tableName, alterOptions, connection); verify(decisionApi, times(1)).alterStream(eq(CATALOG + "_" + TABLE), Matchers.anyList()); }
@Test(expected = ExecutionException.class) public void alterTableNotSupportedTest() throws Exception { TableName tableName = new TableName(CATALOG, TABLE); AlterOptions alterOptions = new AlterOptions(AlterOperation.DROP_COLUMN, null, null); decisionMetadataEngine.alterTable(tableName, alterOptions, connection); }