### Question:
MasterSlaveDataSource extends AbstractDataSourceAdapter { public static String getDataSourceName(final String dataSourceName, final SQLType sqlType) { return isMasterRoute(sqlType) ? getMasterDataSourceName(dataSourceName) : getSlaveDataSourceName(dataSourceName); }  static String getDataSourceName(final String dataSourceName, final SQLType sqlType); DataSource getDataSource(final SQLType sqlType); String getDatabaseProductName(); @Override Connection getConnection(); static void resetDMLFlag();  }### Answer:
@Test public void assertGetDataSourceNameForSelect() { assertThat(MasterSlaveDataSource.getDataSourceName("test_ds", SQLType.DQL), is("test_ds-SLAVE")); }
@Test public void assertGetDataSourceNameForInsert() { assertThat(MasterSlaveDataSource.getDataSourceName("test_ds", SQLType.DML), is("test_ds-MASTER")); }
@Test public void assertGetDataSourceNameForMasterRouteOnly() { HintManager hintManager = HintManager.getInstance(); hintManager.setMasterRouteOnly(); assertThat(MasterSlaveDataSource.getDataSourceName("test_ds", SQLType.DQL), is("test_ds-MASTER")); }