@Test
  public void initiate() throws Exception {
    Person bob = new Person(UUID.randomUUID());
    String sessionId = (new Date()).toString();
    securityService.setCurrent(bob);

    UUID selfHelpGuideId = UUID.randomUUID();

    SelfHelpGuide selfHelpGuide = new SelfHelpGuide();
    SelfHelpGuideResponse selfHelpGuideResponse = new SelfHelpGuideResponse();

    expect(selfHelpGuideService.get(selfHelpGuideId)).andReturn(selfHelpGuide);

    expect(service.initiateSelfHelpGuideResponse(selfHelpGuide, bob, sessionId))
        .andReturn(selfHelpGuideResponse);

    replay(service);
    replay(selfHelpGuideService);

    String response = controller.initiate(selfHelpGuideId);

    verify(service);
    verify(selfHelpGuideService);
    assertEquals(selfHelpGuideResponse.toString(), response);
  }
 /** Setup the security service with the administrator user. */
 @Before
 public void setUp() {
   securityService.setCurrent(
       new Person(Person.SYSTEM_ADMINISTRATOR_ID),
       "ROLE_PERSON_PROGRAM_STATUS_READ",
       "ROLE_PERSON_PROGRAM_STATUS_WRITE",
       "ROLE_PERSON_PROGRAM_STATUS_DELETE");
 }
 /** Setup the security service with the administrator user. */
 @Before
 public void setUp() {
   securityService.setCurrent(
       new Person(Person.SYSTEM_ADMINISTRATOR_ID),
       confidentialityLevelService.confidentialityLevelsAsGrantedAuthorities(),
       "ROLE_PERSON_JOURNAL_ENTRY_READ",
       "ROLE_PERSON_JOURNAL_ENTRY_WRITE",
       "ROLE_PERSON_JOURNAL_ENTRY_DELETE",
       CONFIDENTIALITY_LEVEL_PERMISSION.asPermissionString());
 }
 /**
  * Setup the security service with the admin user for use by {@link
  * #testControllerCreateAndDelete()} that checks that the Auditable auto-fill properties are
  * correctly filled.
  */
 @Before
 public void setUp() {
   securityService.setCurrent(new Person(Person.SYSTEM_ADMINISTRATOR_ID));
 }