From 5be97c0a2df9297b51c00b44729def4251cbc5bd Mon Sep 17 00:00:00 2001
From: kaloyane <kaloyane>
Date: Wed, 26 Oct 2011 09:09:10 +0000
Subject: [PATCH] fix failing test build

SVN: 23437
---
 .../crowd/CrowdAuthenticationServiceTest.java | 23 ++++++++++++-------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/authentication/sourceTest/java/ch/systemsx/cisd/authentication/crowd/CrowdAuthenticationServiceTest.java b/authentication/sourceTest/java/ch/systemsx/cisd/authentication/crowd/CrowdAuthenticationServiceTest.java
index 6772aac71c5..ad518362a43 100644
--- a/authentication/sourceTest/java/ch/systemsx/cisd/authentication/crowd/CrowdAuthenticationServiceTest.java
+++ b/authentication/sourceTest/java/ch/systemsx/cisd/authentication/crowd/CrowdAuthenticationServiceTest.java
@@ -115,8 +115,7 @@ public class CrowdAuthenticationServiceTest
         final boolean result =
                 authenticationService.authenticateUser(USER, USER_PASSWORD);
         assertEquals(true, result);
-        assertEquals(createDebugLogEntry("CROWD: application '" + APPLICATION
-                + "' successfully authenticated.")
+        assertEquals(createAuthenticatedSuccessfullyLog()
                 + OSUtilities.LINE_SEPARATOR
                 + createInfoLogEntry("CROWD: authentication of user '" + USER + "', application '"
                         + APPLICATION + "': SUCCESS."), logRecorder.getLogContent());
@@ -150,8 +149,7 @@ public class CrowdAuthenticationServiceTest
         final boolean result =
                 authenticationService.authenticateUser(USER, USER_PASSWORD);
         assertEquals(false, result);
-        assertEquals(createDebugLogEntry("CROWD: application '" + APPLICATION
-                + "' successfully authenticated.")
+        assertEquals(createAuthenticatedSuccessfullyLog()
                 + OSUtilities.LINE_SEPARATOR
                 + createDebugLogEntry("Element '" + CrowdSoapElements.OUT
                         + "' could not be found in 'error'.")
@@ -205,8 +203,7 @@ public class CrowdAuthenticationServiceTest
         assertEquals("false", result.getProperty("requiresPasswordChange"));
         assertEquals("1169440408520", result.getProperty("lastAuthenticated"));
         assertEquals("1168995491407", result.getProperty("passwordLastChanged"));
-        assertEquals(createDebugLogEntry("CROWD: application '" + APPLICATION
-                + "' successfully authenticated."), logRecorder.getLogContent());
+        assertEquals(createAuthenticatedSuccessfullyLog(), logRecorder.getLogContent());
         context.assertIsSatisfied();
     }
 
@@ -241,8 +238,7 @@ public class CrowdAuthenticationServiceTest
         }
 
         assertEquals(
-                createDebugLogEntry("CROWD: application '" + APPLICATION
-                        + "' successfully authenticated.")
+                createAuthenticatedSuccessfullyLog()
                         + OSUtilities.LINE_SEPARATOR
                         + createDebugLogEntry("No SOAPAttribute element could be found in the SOAP XML response."),
                 logRecorder.getLogContent());
@@ -250,6 +246,17 @@ public class CrowdAuthenticationServiceTest
         context.assertIsSatisfied();
     }
 
+    private String createAuthenticatedSuccessfullyLog()
+    {
+        final String authenticateLogs =
+                createInfoLogEntry("CROWD: Attempting to authenticate as application "
+                        + APPLICATION + "...")
+                        + OSUtilities.LINE_SEPARATOR
+                        + createInfoLogEntry("CROWD: application '" + APPLICATION
+                                + "' successfully authenticated.");
+        return authenticateLogs;
+    }
+
     private String createDebugLogEntry(final String message)
     {
         return createLogEntry("DEBUG", message);
-- 
GitLab