### Question:
HqlTranslator { Map<String, List<TableTranslation>> getMappings() { return mappings; } @Autowired  HqlTranslator(TableReplications tableReplications); String translate(String viewQualifiedName, String hql);  }### Answer:
@Test public void mappings() { Map<String, String> replicationMappings = ImmutableMap .<String, String> builder() .put("db1.table_a", "r_db.a_table") .put("odb.o_table", "r_db.r_table") .build(); when(tableReplication.getTableMappings()).thenReturn(replicationMappings); HqlTranslator translator = new HqlTranslator(tableReplications); assertThat(translator.getMappings().size(), is(1)); List<TableTranslation> translations = translator.getMappings().get(VIEW_NAME); assertThat(translations.size(), is(2)); assertThat(translations.contains(new TableTranslation("db1", "table_a", "r_db", "a_table")), is(true)); assertThat(translations.contains(new TableTranslation("odb", "o_table", "r_db", "r_table")), is(true)); }