function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
tdeptdep 

test for simple redirect class

I have a simple class that redirects the browser to a third party site when they access a specific portal page. I have no idea how to setup a test for this, can anyone assist?

 

Here is the code:

public with sharing class analyticsforward {

 public PageReference redirect() {
        
            PageReference homePage = new PageReference('URL Removed for Post');
            homePage.setRedirect(true);
            return homePage;
                }


        
}

 Thanks in advance