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

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-wagon.git


The following commit(s) were added to refs/heads/master by this push:
     new bfcc820  Fix flaky test with path info checks
bfcc820 is described below

commit bfcc820e2c93a94a3a660376f9384090cbd2e7c4
Author: Michael Osipov <micha...@apache.org>
AuthorDate: Fri Feb 21 12:43:12 2020 +0100

    Fix flaky test with path info checks
    
    This test solely searched the entire URL for the status path, but it
    ignored the fact that a random port could contain the status code too.
---
 .../maven/wagon/providers/http/ErrorWithMessageServlet.java    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/ErrorWithMessageServlet.java
 
b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/ErrorWithMessageServlet.java
index bf74118..1d76412 100644
--- 
a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/ErrorWithMessageServlet.java
+++ 
b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/ErrorWithMessageServlet.java
@@ -40,23 +40,23 @@ public class ErrorWithMessageServlet
     public void service( HttpServletRequest request, HttpServletResponse 
response )
         throws ServletException, IOException
     {
-        if ( request.getRequestURL().toString().contains( "401" ) )
+        if ( request.getPathInfo().endsWith( "/401" ) )
         {
             response.sendError( 401, MESSAGE );
         }
-        else if ( request.getRequestURL().toString().contains( "403" ) )
+        else if ( request.getPathInfo().endsWith( "/403" ) )
         {
             response.sendError( 403, MESSAGE );
         }
-        else if ( request.getRequestURL().toString().contains( "404" ) )
+        else if ( request.getPathInfo().endsWith( "/404" ) )
         {
             response.sendError( 404, MESSAGE );
         }
-        else if ( request.getRequestURL().toString().contains( "407" ) )
+        else if ( request.getPathInfo().endsWith( "/407" ) )
         {
             response.sendError( 407, MESSAGE );
         }
-        else if ( request.getRequestURL().toString().contains( "500" ) )
+        else if ( request.getPathInfo().endsWith( "/500" ) )
         {
             response.sendError( 500, MESSAGE );
         }

Reply via email to