JobIdGenerator implements ILogoutListener, IJobIdGenerator { @Override public void onLogout( final IPentahoSession session ) { if ( session != null ) { reservedIds.remove( session ); } } JobIdGenerator(); @Override void onLogout( final IPentahoSession session ); @Override UUID generateId( final IPentahoSession session ); @Override boolean acquire( final IPentahoSession session, final UUID id ); static final String ID; }
@Test public void onLogout() throws Exception { final JobIdGenerator jobIdGenerator = new JobIdGenerator(); final IPentahoSession mock = mock( IPentahoSession.class ); final UUID generateId = jobIdGenerator.generateId( mock ); assertNotNull( generateId ); jobIdGenerator.onLogout( mock ); assertFalse( jobIdGenerator.acquire( mock, generateId ) ); }