You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2014/10/22 22:42:53 UTC

[07/13] git commit: Fixed issue and added onto previous test so that the issue can be tested.

Fixed issue and added onto previous test so that the issue can be tested.

Signed-off-by: grey <gr...@apigee.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/c78e0a41
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/c78e0a41
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/c78e0a41

Branch: refs/heads/master
Commit: c78e0a41a9b5774b3fc8524a12b3b386186e1751
Parents: 2bfbe41
Author: grey <gr...@apigee.com>
Authored: Mon Jul 21 17:15:26 2014 -0700
Committer: grey <gr...@apigee.com>
Committed: Fri Jul 25 13:40:08 2014 -0700

----------------------------------------------------------------------
 .../cassandra/ManagementServiceImpl.java        | 13 ++++++------
 .../apache/usergrid/management/EmailFlowIT.java | 22 +++++++++++++-------
 2 files changed, 21 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c78e0a41/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
index 8b45dd0..1b9bbc5 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
@@ -31,6 +31,11 @@ import java.util.UUID;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang.text.StrSubstitutor;
+import org.apache.shiro.UnavailableSecurityManagerException;
+
 import org.apache.usergrid.locking.Lock;
 import org.apache.usergrid.locking.LockManager;
 import org.apache.usergrid.management.AccountCreationProps;
@@ -91,10 +96,6 @@ import org.apache.usergrid.utils.MailUtils;
 import org.apache.usergrid.utils.StringUtils;
 import org.apache.usergrid.utils.UUIDUtils;
 
-import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.lang.text.StrSubstitutor;
-import org.apache.shiro.UnavailableSecurityManagerException;
-
 import com.google.common.collect.BiMap;
 import com.google.common.collect.HashBiMap;
 
@@ -2256,8 +2257,8 @@ public class ManagementServiceImpl implements ManagementService {
 
 
     public void sendAdminUserConfirmedAwaitingActivationEmail( UserInfo user ) throws Exception {
-        sendAdminUserEmail( user, "User Account Confirmed",
-                properties.getProperty( PROPERTIES_EMAIL_ADMIN_CONFIRMED_AWAITING_ACTIVATION ) );
+        sendAdminUserEmail(user, "User Account Confirmed",
+                emailMsg( hashMap("confirmed_email",user.getEmail() ),PROPERTIES_EMAIL_ADMIN_CONFIRMED_AWAITING_ACTIVATION ) );
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c78e0a41/stack/services/src/test/java/org/apache/usergrid/management/EmailFlowIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/EmailFlowIT.java b/stack/services/src/test/java/org/apache/usergrid/management/EmailFlowIT.java
index b4a7023..ab4b34c 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/EmailFlowIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/EmailFlowIT.java
@@ -35,6 +35,10 @@ import org.junit.rules.TestName;
 import org.jvnet.mock_javamail.Mailbox;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.text.StrSubstitutor;
+
 import org.apache.usergrid.ServiceITSetup;
 import org.apache.usergrid.ServiceITSetupImpl;
 import org.apache.usergrid.cassandra.CassandraResource;
@@ -46,15 +50,7 @@ import org.apache.usergrid.persistence.cassandra.CassandraService;
 import org.apache.usergrid.persistence.entities.Application;
 import org.apache.usergrid.persistence.entities.User;
 
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.text.StrSubstitutor;
-
 import static org.apache.commons.lang.StringUtils.isNotBlank;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION;
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_EMAIL_ADMIN_ACTIVATED;
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_EMAIL_ADMIN_CONFIRMATION;
@@ -76,6 +72,11 @@ import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_SYS
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_USER_ACTIVATION_URL;
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_USER_CONFIRMATION_URL;
 import static org.apache.usergrid.management.AccountCreationProps.PROPERTIES_USER_RESETPW_URL;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertTrue;
 
 
 /**
@@ -165,6 +166,11 @@ public class EmailFlowIT {
         assertEquals( ActivationState.CONFIRMED_AWAITING_ACTIVATION, state );
 
         confirmation = user_inbox.get( 1 );
+        String body = ( ( MimeMultipart ) confirmation.getContent() ).getBodyPart( 0 ).getContent().toString();
+        Boolean subbedEmailed = StringUtils.contains( body, "$" );
+
+        assertFalse( subbedEmailed );
+
         assertEquals( "User Account Confirmed", confirmation.getSubject() );
 
         List<Message> sysadmin_inbox = Mailbox.get( "sysadmin-2@mockserver.com" );