}
@SuppressWarnings({ "rawtypes", "unchecked", "unused" })
Index mockIndex(String indexName, com.gemstone.gemfire.cache.query.IndexType indexType, String indexedExpression,
String fromClause, String imports){
Index idx = mock(Index.class);
when(idx.getFromClause()).thenReturn(fromClause);
when(idx.getIndexedExpression()).thenReturn(indexedExpression);
when(idx.getName()).thenReturn(indexName);
when(idx.getType()).thenReturn(indexType);
if (fromClause != null && fromClause.length() >= 2) {
Region region = mock(Region.class);
String name = fromClause.substring(1).split(" ")[0];
when(region.getName()).thenReturn(name);
when(idx.getRegion()).thenReturn(region);
}
return idx;
}