Shireesh Anjal has uploaded a new change for review.

Change subject: webadmin: fix NPE in WebAdminHostPageServletTest
......................................................................

webadmin: fix NPE in WebAdminHostPageServletTest

Two @Before methods in WebAdminHostPageServletTest is causing the tests
to fail with NPE on my laptop. Merging them into single one resolves the
problem.

Change-Id: Ib76f7bd842d3b58c522e3e97609a9b55d5a79902
Signed-off-by: Shireesh Anjal <san...@redhat.com>
---
M 
frontend/webadmin/modules/frontend/src/test/java/org/ovirt/engine/ui/frontend/server/gwt/WebAdminHostPageServletTest.java
1 file changed, 3 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/50/13350/1

diff --git 
a/frontend/webadmin/modules/frontend/src/test/java/org/ovirt/engine/ui/frontend/server/gwt/WebAdminHostPageServletTest.java
 
b/frontend/webadmin/modules/frontend/src/test/java/org/ovirt/engine/ui/frontend/server/gwt/WebAdminHostPageServletTest.java
index 28864fb..84119ab 100644
--- 
a/frontend/webadmin/modules/frontend/src/test/java/org/ovirt/engine/ui/frontend/server/gwt/WebAdminHostPageServletTest.java
+++ 
b/frontend/webadmin/modules/frontend/src/test/java/org/ovirt/engine/ui/frontend/server/gwt/WebAdminHostPageServletTest.java
@@ -45,18 +45,14 @@
 
     @Before
     public void setUpMockRequest() {
-        
when(mockApplicationModeObject.toString()).thenReturn(APPLICATION_MODE);
-        
when(mockRequest.getAttribute(WebAdminHostPageServlet.ATTR_APPLICATION_MODE)).thenReturn(mockApplicationModeObject);
-        
when(mockRequest.getAttribute(WebAdminHostPageServlet.ATTR_PLUGIN_DEFS)).thenReturn(mockPluginDefinitionsArray);
-    }
-
-    @Before
-    public void stubPluginDefinitionsArray() {
         ObjectMapper mapper = new ObjectMapper();
         ObjectNode mockPluginDef = mapper.createObjectNode();
         mockPluginDef.put("foo", "bar"); //$NON-NLS-1$ //$NON-NLS-2$
         mockPluginDefinitionsArray = mapper.createArrayNode();
         mockPluginDefinitionsArray.add(mockPluginDef);
+        
when(mockApplicationModeObject.toString()).thenReturn(APPLICATION_MODE);
+        
when(mockRequest.getAttribute(WebAdminHostPageServlet.ATTR_APPLICATION_MODE)).thenReturn(mockApplicationModeObject);
+        
when(mockRequest.getAttribute(WebAdminHostPageServlet.ATTR_PLUGIN_DEFS)).thenReturn(mockPluginDefinitionsArray);
     }
 
     @Override


--
To view, visit http://gerrit.ovirt.org/13350
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib76f7bd842d3b58c522e3e97609a9b55d5a79902
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shireesh Anjal <san...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to