}
@Test
public void reconcileFromDB() {
// update sync task
TaskExecTO execution = execSyncTask(7L, 50, false);
assertNotNull(execution.getStatus());
assertTrue(PropagationTaskExecStatus.valueOf(execution.getStatus()).isSuccessful());
UserTO userTO = readUser("testuser1");
assertNotNull(userTO);
assertEquals("reconciled@syncope.apache.org", userTO.getAttrMap().get("userId").getValues().get(0));
assertEquals("suspended", userTO.getStatus());
// enable user on external resource
JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
jdbcTemplate.execute("UPDATE TEST SET STATUS=TRUE");
// re-execute the same SyncTask: now user must be active
execution = execSyncTask(7L, 50, false);
assertNotNull(execution.getStatus());
assertTrue(PropagationTaskExecStatus.valueOf(execution.getStatus()).isSuccessful());
userTO = readUser("testuser1");
assertNotNull(userTO);
assertEquals("active", userTO.getStatus());
}