UpgradeCatalog222 extends AbstractUpgradeCatalog { protected void updateHostRoleCommands() throws SQLException { dbAccessor.createIndex("idx_hrc_status_role", "host_role_command", "status", "role"); } @Inject  UpgradeCatalog222(Injector injector); @Override String getTargetVersion(); @Override String getSourceVersion(); static final String PRECISION_TABLE_TTL_PROPERTY; static final String CLUSTER_SECOND_TABLE_TTL_PROPERTY; static final String CLUSTER_MINUTE_TABLE_TTL_PROPERTY; static final String AMS_WEBAPP_ADDRESS_PROPERTY; static final String HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD_PROPERTY; static final String HBASE_RPC_TIMEOUT_PROPERTY; static final String PHOENIX_QUERY_TIMEOUT_PROPERTY; static final String PHOENIX_QUERY_KEEPALIVE_PROPERTY; static final String TIMELINE_METRICS_CLUSTER_AGGREGATOR_INTERPOLATION_ENABLED; static final String TIMELINE_METRICS_SINK_COLLECTION_PERIOD; static final String AMS_SERVICE_NAME; static final String AMS_COLLECTOR_COMPONENT_NAME; final static String HBASE_SITE_HBASE_COPROCESSOR_MASTER_CLASSES; final static String HBASE_SITE_HBASE_COPROCESSOR_REGION_CLASSES; final static String HBASE_SITE_HBASE_COPROCESSOR_REGIONSERVER_CLASSES; }
@Test public void testUpdateHostRoleCommands() throws Exception { final DBAccessor dbAccessor = createNiceMock(DBAccessor.class); dbAccessor.createIndex(eq("idx_hrc_status_role"), eq("host_role_command"), eq("status"), eq("role")); expectLastCall().once(); replay(dbAccessor); Module module = new Module() { @Override public void configure(Binder binder) { binder.bind(DBAccessor.class).toInstance(dbAccessor); binder.bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class)); } }; Injector injector = Guice.createInjector(module); UpgradeCatalog222 upgradeCatalog222 = injector.getInstance(UpgradeCatalog222.class); upgradeCatalog222.updateHostRoleCommands(); verify(dbAccessor); }