Moti Asayag has submitted this change and it was merged.
Change subject: userportal,webadmin: WelcomeServletTest improvement
......................................................................
userportal,webadmin: WelcomeServletTest improvement
This patch applies common pattern for testing servlet classes:
public class MyServlet extends HttpServlet {
...
private ServletDependency dep;
@Override
// Called by servlet container at runtime
public void init() {
init(new ServletDependencyImpl());
}
// Package-private visibility, method used by MyServletTest
void init(ServletDependency dep) {
this.dep = dep;
}
...
}
In this patch, WelcomeServletTest uses BrandingManager mock instead
of real BrandingManager implementation to ensure WelcomeServlet is
tested properly in isolation, i.e. using mocked dependencies.
Change-Id: I2d654ce7ca57f8bd8962ab668a0c13e1e09d80f3
Signed-off-by: Vojtech Szocs <vszocs(a)redhat.com>
---
M backend/manager/modules/root/src/main/java/org/ovirt/engine/core/WelcomeServlet.java
M
backend/manager/modules/root/src/test/java/org/ovirt/engine/core/WelcomeServletTest.java
2 files changed, 21 insertions(+), 2 deletions(-)
Approvals:
Moti Asayag: Verified; Looks good to me, approved
--
To view, visit
http://gerrit.ovirt.org/17433
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2d654ce7ca57f8bd8962ab668a0c13e1e09d80f3
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vojtech Szocs <vszocs(a)redhat.com>
Gerrit-Reviewer: Alexander Wels <awels(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Einav Cohen <ecohen(a)redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchaplik(a)redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag(a)redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek(a)redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vszocs(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server