← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6554: Minor fix

 

------------------------------------------------------------
revno: 6554
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-04-12 22:05:29 +0200
message:
  Minor fix
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/scheduling/TaskId.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/notification/NotifierTest.java
  dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/scheduling/TaskId.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/scheduling/TaskId.java	2012-04-12 12:39:47 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/scheduling/TaskId.java	2012-04-12 20:05:29 +0000
@@ -38,11 +38,6 @@
     
     private String id;
     
-    public TaskId( String id )
-    {
-        this.id = id;
-    }
-    
     public TaskId( TaskCategory category, User user )
     {
         this.id = category.toString() + SEPARATOR + user.getUserCredentials().getUsername();

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/notification/NotifierTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/notification/NotifierTest.java	2012-04-12 12:39:47 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/notification/NotifierTest.java	2012-04-12 20:05:29 +0000
@@ -38,6 +38,7 @@
 import org.hisp.dhis.scheduling.TaskId;
 import org.hisp.dhis.system.notification.Notification;
 import org.hisp.dhis.system.notification.Notifier;
+import org.hisp.dhis.user.User;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -50,9 +51,11 @@
     @Autowired
     private Notifier notifier;
 
-    private TaskId id1 = new TaskId( "DATAVALUE_IMPORT-admin" );
-    private TaskId id2 = new TaskId( "DATAMART-admin" );
-    private TaskId id3 = new TaskId( "METADATA_IMPORT-admin" );
+    private User user = createUser( 'A' );
+    
+    private TaskId id1 = new TaskId( TaskCategory.DATAVALUE_IMPORT, user );
+    private TaskId id2 = new TaskId( TaskCategory.DATAMART, user );
+    private TaskId id3 = new TaskId( TaskCategory.METADATA_IMPORT, user );
     
     @Test
     public void testNotifiy()

=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java	2012-02-16 12:58:37 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java	2012-04-12 20:05:29 +0000
@@ -90,6 +90,7 @@
 import org.hisp.dhis.resourcetable.ResourceTableService;
 import org.hisp.dhis.sqlview.SqlView;
 import org.hisp.dhis.user.User;
+import org.hisp.dhis.user.UserCredentials;
 import org.hisp.dhis.user.UserGroup;
 import org.hisp.dhis.user.UserService;
 import org.hisp.dhis.validation.ValidationCriteria;
@@ -837,6 +838,11 @@
         user.setEmail( "Email" + uniqueCharacter );
         user.setPhoneNumber( "PhoneNumber" + uniqueCharacter );
 
+        UserCredentials credentials = new UserCredentials();
+        credentials.setUsername( "username" );
+        
+        user.setUserCredentials( credentials );
+        
         return user;
     }