### Question:
UpgradeCatalog271 extends AbstractUpgradeCatalog { protected void removeLogSearchPatternConfigs() throws SQLException { DBAccessor dba = dbAccessor != null ? dbAccessor : injector.getInstance(DBAccessor.class); String configSuffix = "-logsearch-conf"; String serviceConfigMappingRemoveSQL = String.format( "DELETE FROM %s WHERE config_id IN (SELECT config_id from %s where type_name like '%%%s')", SERVICE_CONFIG_MAPPING_TABLE, CLUSTER_CONFIG_TABLE, configSuffix); String clusterConfigRemoveSQL = String.format( "DELETE FROM %s WHERE type_name like '%%%s'", CLUSTER_CONFIG_TABLE, configSuffix); dba.executeQuery(serviceConfigMappingRemoveSQL); dba.executeQuery(clusterConfigRemoveSQL); } @Inject  UpgradeCatalog271(Injector injector); @Override String getTargetVersion(); @Override String getSourceVersion();  }### Answer:
@Test public void testRemoveLogSearchPatternConfigs() throws Exception { EasyMockSupport easyMockSupport = new EasyMockSupport(); Injector injector = easyMockSupport.createNiceMock(Injector.class); DBAccessor dbAccessor = easyMockSupport.createNiceMock(DBAccessor.class); expect(injector.getInstance(DBAccessor.class)).andReturn(dbAccessor).anyTimes(); String serviceConfigMapping = "serviceconfigmapping"; String clusterConfig = "clusterconfig"; dbAccessor.executeQuery(startsWith("DELETE FROM "+ serviceConfigMapping)); expectLastCall().once(); dbAccessor.executeQuery(startsWith("DELETE FROM "+ clusterConfig)); expectLastCall().once(); replay(dbAccessor, injector); new UpgradeCatalog271(injector).removeLogSearchPatternConfigs(); easyMockSupport.verifyAll(); }