This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 58061be  ISIS-1976: further fixing some tests
58061be is described below

commit 58061be7d0c356fd1a58dd4eea63fd21d23b4c5a
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Wed Sep 5 09:34:52 2018 +0200

    ISIS-1976: further fixing some tests
    
    reason: IsisSessionFactory does no longer live on the ServletContext
    
    Task-Url: https://issues.apache.org/jira/browse/ISIS-1976
---
 ...text_ensureCompatibleAcceptHeader_ContractTest.java | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git 
a/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContext_ensureCompatibleAcceptHeader_ContractTest.java
 
b/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContext_ensureCompatibleAcceptHeader_ContractTest.java
index 10f5b02..c438d3a 100644
--- 
a/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContext_ensureCompatibleAcceptHeader_ContractTest.java
+++ 
b/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContext_ensureCompatibleAcceptHeader_ContractTest.java
@@ -18,6 +18,9 @@
  */
 package org.apache.isis.viewer.restfulobjects.server;
 
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -35,6 +38,7 @@ import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 
+import org.apache.isis.commons.internal.context._Context;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
@@ -48,9 +52,6 @@ import 
org.apache.isis.viewer.restfulobjects.applib.RepresentationType;
 import 
org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
 import 
org.apache.isis.viewer.restfulobjects.rendering.RestfulObjectsApplicationException;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
 public abstract class 
ResourceContext_ensureCompatibleAcceptHeader_ContractTest {
 
     @Rule
@@ -71,15 +72,18 @@ public abstract class 
ResourceContext_ensureCompatibleAcceptHeader_ContractTest
     @Before
     public void setUp() throws Exception {
         deploymentCategory = DeploymentCategory.PRODUCTION;
+        
+        _Context.put(IsisSessionFactory.class, mockIsisSessionFactory, false);
 
         context.checking(new Expectations() {
             {
                 allowing(mockHttpServletRequest).getQueryString();
                 will(returnValue(""));
-                allowing(mockHttpServletRequest).getServletContext();
-                will(returnValue(mockServletContext));
-                
allowing(mockServletContext).getAttribute("org.apache.isis.core.webapp.isisSessionFactory");
-                will(returnValue(mockIsisSessionFactory));
+                //[ISIS-1976] IsisSessionFactory does no longer live on the 
ServletContext
+//              allowing(mockHttpServletRequest).getServletContext();
+//              will(returnValue(mockServletContext));
+//              
allowing(mockServletContext).getAttribute("org.apache.isis.core.webapp.isisSessionFactory");
+//              will(returnValue(mockIsisSessionFactory));
                 allowing(mockIsisSessionFactory).getServicesInjector();
                 will(returnValue(mockServicesInjector));
                 allowing(mockIsisSessionFactory).getConfiguration();

Reply via email to