public void should_fetch_table_meta_from_different_keyspaces() throws Exception {
//Given
EntityMeta meta1 = mock(EntityMeta.class, RETURNS_DEEP_STUBS);
EntityMeta meta2 = mock(EntityMeta.class, RETURNS_DEEP_STUBS);
KeyspaceMetadata ks1Meta = mock(KeyspaceMetadata.class, RETURNS_DEEP_STUBS);
KeyspaceMetadata ks2Meta = mock(KeyspaceMetadata.class, RETURNS_DEEP_STUBS);
TableMetadata tableMeta1 = mock(TableMetadata.class, RETURNS_DEEP_STUBS);
TableMetadata tableMeta2 = mock(TableMetadata.class, RETURNS_DEEP_STUBS);
when(meta1.config().getKeyspaceName()).thenReturn("ks1");
when(meta1.config().getTableName()).thenReturn("table1");
when(meta1.config().getQualifiedTableName()).thenReturn("ks1.table1");
when(meta2.config().getKeyspaceName()).thenReturn("ks2");
when(meta2.config().getTableName()).thenReturn("table2");
when(meta2.config().getQualifiedTableName()).thenReturn("ks2.table2");
when(cluster.getMetadata().getKeyspace("ks1")).thenReturn(ks1Meta);
when(cluster.getMetadata().getKeyspace("ks2")).thenReturn(ks2Meta);
when(ks1Meta.getTable("table1")).thenReturn(tableMeta1);
when(ks2Meta.getTable("table2")).thenReturn(tableMeta2);
//When
final Map<String, TableMetadata> tableMetaData = reader.fetchTableMetaData(cluster, Arrays.asList(meta1, meta2));
//Then