@Test
public void testAcceptCompleted() {

	String hitId = "testHITId";
	String assignmentId = "testAssignmentId";
	String workerId = "workerId";
	
	Session s = new Session();		
	s.setHitId(hitId);
	s.setWorkerId(workerId);
	s.setInactivePercent(0.00);
	
	tracker.saveSession(s);
	
	// Pretend that we have a previous HITWorker for this guy
	HITWorkerImpl hitw = new HITWorkerImpl(null, s);
	server.hitWorkerTable.put(hitId, workerId, hitw);
	
	assertEquals(0, server.completedHITs);
	assertEquals(SessionStatus.COMPLETED, SessionRecord.status(s));		
	
	MockServerSession conn = new MockServerSession();
	
	server.sessionAccept(conn, hitId, assignmentId, workerId);
	
	assertEquals(conn.lastChannel, USER_CHANNEL);
	assertEquals(Codec.status_expfinished, ((Map<String, Object>) conn.lastData).get("status"));				
	
	// Try to submit the HIT and ensure it goes through
	server.updateCompletion();
	server.sessionSubmit(conn, "some random results");
			
	assertEquals(conn.lastChannel, USER_CHANNEL);
	assertEquals(Codec.status_completed, ((Map<String, Object>) conn.lastData).get("status"));
	assertEquals(1, server.completedHITs);
	
	// Make sure that a double-submit doesn't count twice
	server.updateCompletion();
	server.sessionSubmit(conn, "some random results");
	
	assertEquals(conn.lastChannel, USER_CHANNEL);
	assertEquals(Codec.status_completed, ((Map<String, Object>) conn.lastData).get("status") );
	assertEquals(1, server.completedHITs);
}