### Question:
UpgradeCatalog270 extends AbstractUpgradeCatalog { protected String updateLuceneMatchVersion(String content, String newLuceneMatchVersion) { return content.replaceAll("<luceneMatchVersion>.*</luceneMatchVersion>", "<luceneMatchVersion>" + newLuceneMatchVersion + "</luceneMatchVersion>"); } @Inject  UpgradeCatalog270(Injector injector); @Override String getTargetVersion(); @Override String getSourceVersion(); static final String[] COMPONENT_NAME_SERVICE_NAME_CLUSTER_ID_KEY_COLUMNS; static final String[] SERVICE_NAME_CLUSTER_ID_KEY_COLUMNS; static final String AMBARI_INFRA_OLD_NAME; static final String AMBARI_INFRA_NEW_NAME; static final String SERVICE_CONFIG_MAPPING_TABLE; static final String CLUSTER_CONFIG_TABLE; static final String FK_HOSTCOMPONENTDESIREDSTATE_COMPONENT_NAME; static final String FK_HOSTCOMPONENTSTATE_COMPONENT_NAME; static final String FK_SERVICECOMPONENTDESIREDSTATE_SERVICE_NAME; }### Answer:
@Test public void testupdateLuceneMatchVersion() throws Exception { String solrConfigXml = IOUtils.toString(getClass().getClassLoader().getResourceAsStream("org/apache/ambari/server/upgrade/solrconfig-v500.xml.j2"), "UTF-8"); UpgradeCatalog270 upgradeCatalog270 = createMockBuilder(UpgradeCatalog270.class) .createMock(); replay(upgradeCatalog270); String updated = upgradeCatalog270.updateLuceneMatchVersion(solrConfigXml,"7.3.1"); assertThat(updated.contains("<luceneMatchVersion>7.3.1</luceneMatchVersion>"), is(true)); assertThat(updated.contains("<luceneMatchVersion>5.0.0</luceneMatchVersion>"), is(false)); verify(upgradeCatalog270); }