### Question:
JobPicker { public boolean extendLock( JobDefinition jd, String clusterID, String workerID ) { ObjectDefinition od = jd.getObjectDefinition(); String objectName = jd.getActualObjectName(); int updated = template.update( UPDATE_LOCK_EXPIRATION, od.getNameSpace(), objectName, od.getUsageCode(), od.getFileType(), clusterID, workerID ,jd.getWfType()); return updated > 0; }  boolean lockObj( JobDefinition jd, String clusterID, String threadID ); void unlockWorker( String clusterID, String threadID ); boolean extendLock( JobDefinition jd, String clusterID, String workerID ); static final String FIND_UNLOCKED_JOB_QUERY; static final String FIND_UNLOCKED_STATS_JOB_QUERY; }### Answer:
@Test @Transactional public void testExtendLock() throws IOException { String sql = new String(Files.readAllBytes(Paths.get("src/test/resources/dbunit/object_lock_dataset.sql"))); template.update(sql); Date originalExpiration = template.queryForObject("select EXPIRATION_DT FROM METASTOR_OBJECT_LOCKS where CLUSTER_ID='C01'", Date.class); assertTrue(originalExpiration.before(Calendar.getInstance().getTime())); jp.lockObj(new JobDefinition(10L, "A1","B1","C","D", "","","",""), "C01", "1"); Date newExpiration = template.queryForObject("select EXPIRATION_DT FROM METASTOR_OBJECT_LOCKS where CLUSTER_ID='C01'", Date.class); Date expectedDt = template.queryForObject("select TIMESTAMPADD(MINUTE, 5, now());", Date.class); assertTrue(Math.abs(expectedDt.getTime() - newExpiration.getTime()) < 5000 ); }