You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2015/07/28 10:48:44 UTC

svn commit: r1693034 - /sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RetryingContentChecker.java

Author: rombert
Date: Tue Jul 28 08:48:43 2015
New Revision: 1693034

URL: http://svn.apache.org/r1693034
Log:
SLING-3873 - Using SlingTestBase does not work with a non-standard
password set on the sling server

Simplify and centralise assigning of username and password in
RetryingContentChecker.

Modified:
    sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RetryingContentChecker.java

Modified: sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RetryingContentChecker.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RetryingContentChecker.java?rev=1693034&r1=1693033&r2=1693034&view=diff
==============================================================================
--- sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RetryingContentChecker.java (original)
+++ sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/http/RetryingContentChecker.java Tue Jul 28 08:48:43 2015
@@ -29,23 +29,14 @@ public class RetryingContentChecker {
     private final String password;
     
     public RetryingContentChecker(RequestExecutor executor, RequestBuilder builder) {
-        this(executor, builder, null, SlingTestBase.ADMIN);
+        this(executor, builder, null, null);
     }
 
     public RetryingContentChecker(RequestExecutor executor, RequestBuilder builder, String username, String password) {
         this.executor = executor;
         this.builder = builder;
-        if (username != null) {
-            this.username = username;
-        } else {
-            this.username = SlingTestBase.ADMIN;
-        }
-
-        if (password != null) {
-            this.password = password;
-        } else {
-            this.password = SlingTestBase.ADMIN;
-        }
+        this.username = username != null ? username : SlingTestBase.ADMIN;
+        this.password = password != null ? password : SlingTestBase.ADMIN;
     }
 
     /** Check specified path for expected status, or timeout */