diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractAsyncCallback.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractAsyncCallback.java
index 08512daae4407a7783a7c957aa1464b3841a8363..9f687e0846c08c03d9a6041c32009a69a505edbb 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractAsyncCallback.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractAsyncCallback.java
@@ -231,6 +231,11 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T>
         if (caught instanceof InvalidSessionException)
         {
             handleSessionTerminated(msg);
+            // only for tests
+            if (staticCallbackListener != DEFAULT_CALLBACK_LISTENER)
+            {
+                callbackListener.onFailureOf(viewContext, this, msg, caught);
+            }
         } else
         {
             callbackListener.onFailureOf(viewContext, this, msg, caught);
@@ -274,6 +279,7 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T>
 
     private void showSessionTerminated(String msg)
     {
+        System.err.println("Session terminated"); // only for tests
         Dialog dialog = new Dialog();
         GWTUtils.setToolTip(dialog, getMessage(Dict.MESSAGEBOX_WARNING));