This is an automated email from the ASF dual-hosted git repository. radcortez pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomee.git
commit 0f046f5354c53a9db4b68879d627794f120a299e Author: Roberto Cortez <[email protected]> AuthorDate: Fri Dec 28 17:07:09 2018 +0000 TOMEE-2365 - Simplified test. --- .../org/apache/tomee/security/servlet/AbstractTomEESecurityTest.java | 4 ++++ .../java/org/apache/tomee/security/servlet/FormAuthServletTest.java | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tomee/tomee-security/src/test/java/org/apache/tomee/security/servlet/AbstractTomEESecurityTest.java b/tomee/tomee-security/src/test/java/org/apache/tomee/security/servlet/AbstractTomEESecurityTest.java index 7e80ce2..8999b2b 100644 --- a/tomee/tomee-security/src/test/java/org/apache/tomee/security/servlet/AbstractTomEESecurityTest.java +++ b/tomee/tomee-security/src/test/java/org/apache/tomee/security/servlet/AbstractTomEESecurityTest.java @@ -43,4 +43,8 @@ public abstract class AbstractTomEESecurityTest { public static void tearDown() throws Exception { container.close(); } + + protected String getAppUrl() { + return "http://localhost:" + container.getConfiguration().getHttpPort(); + } } diff --git a/tomee/tomee-security/src/test/java/org/apache/tomee/security/servlet/FormAuthServletTest.java b/tomee/tomee-security/src/test/java/org/apache/tomee/security/servlet/FormAuthServletTest.java index 8a63dd6..4a8ccf7 100644 --- a/tomee/tomee-security/src/test/java/org/apache/tomee/security/servlet/FormAuthServletTest.java +++ b/tomee/tomee-security/src/test/java/org/apache/tomee/security/servlet/FormAuthServletTest.java @@ -40,8 +40,7 @@ public class FormAuthServletTest extends AbstractTomEESecurityTest { @Test public void authenticate() throws Exception { final WebClient webClient = new WebClient(); - final HtmlPage page = - webClient.getPage("http://localhost:" + container.getConfiguration().getHttpPort() + "/form"); + final HtmlPage page = webClient.getPage(getAppUrl() + "/form"); assertEquals(200, page.getWebResponse().getStatusCode()); final HtmlForm login = page.getFormByName("login");
