ConfigReleaseIbatisDao extends SqlMapClientDaoSupport implements ConfigReleaseDao { @Override public ConfigSnapshotSet findSnapshotSetToRollback(int projectId, int envId, String task) { return (ConfigSnapshotSet) getSqlMapClientTemplate().queryForObject("ConfigRelease.findSnapshotSetWithTask", Maps.entry("projectId", projectId).entry("envId", envId).entry("task", task).get()); }  @Override int createSetTask(ConfigSetTask task); @SuppressWarnings("unchecked") @Override List<ConfigSetTask> getSetTask(int projectId, int envId, String[] features, String[] keys); @Override int createConfigSnapshotSet(ConfigSnapshotSet snapshot); @Override void createConfigSnapshots(List<ConfigSnapshot> configSnapshots); @Override void createConfigInstSnapshots(List<ConfigInstanceSnapshot> configInstSnapshots); @Override ConfigSnapshotSet findSnapshotSetToRollback(int projectId, int envId, String task); @SuppressWarnings("unchecked") @Override List<ConfigSnapshot> findConfigSnapshots(int snapshotSetId); @SuppressWarnings("unchecked") @Override List<ConfigInstanceSnapshot> findConfigInstSnapshots(int snapshotSetId);  }
@Test public void testFindSnapshotSetToRollback() { configReleaseDao.createConfigSnapshotSet(buildConfigSnapshotSet(Project_Foo_Id, Env1_Id, Task_1)); configReleaseDao.createConfigSnapshotSet(buildConfigSnapshotSet(Project_Foo_Id, Env1_Id, Task_2)); ConfigSnapshotSet snapshotSet = configReleaseDao.findSnapshotSetToRollback(Project_Foo_Id, Env1_Id, Task_1); assertNotNull(snapshotSet); assertEquals(Task_2, snapshotSet.getTask()); snapshotSet = configReleaseDao.findSnapshotSetToRollback(Project_Foo_Id, Env2_Id, Task_1); assertNull(snapshotSet); }