@Override public Repository getRepository() {
    IPentahoSession session = pentahoSessionSupplier.get();
    if ( session == null ) {
      LOGGER.debug( "No active Pentaho Session, attempting to load PDI repository unauthenticated." );
      return null;
    }
    ICacheManager cacheManager = cacheManagerFunction.apply( session );

    String sessionName = session.getName();
    Repository repository = (Repository) cacheManager.getFromRegionCache( REGION, sessionName );
    if ( repository == null ) {
      LOGGER.debug( "Repository not cached for user: " + sessionName + "." );
      return null;
    }
    return repository;
  }
@Test
  public void testGetRepositoryNull() {
    when( pentahoSessionSupplier.get() ).thenReturn( pentahoSession );
    when( cacheManager.getFromRegionCache( PentahoSessionHolderRepositoryProvider.REGION, SESSION_TEST_NAME ) ).thenReturn( null );
    assertNull( pentahoSessionHolderRepositoryProvider.getRepository() );
  }