diff --git a/framework/default/ortoo-lwc-list-view-buttons/classes/AbstractRedirectToLwcTabController.cls b/framework/default/ortoo-lwc-list-view-buttons/classes/AbstractRedirectToLwcTabController.cls index c59e081876f..274ab7a9cca 100644 --- a/framework/default/ortoo-lwc-list-view-buttons/classes/AbstractRedirectToLwcTabController.cls +++ b/framework/default/ortoo-lwc-list-view-buttons/classes/AbstractRedirectToLwcTabController.cls @@ -9,7 +9,7 @@ */ public virtual with sharing class AbstractRedirectToLwcTabController { - protected String tabPageName; + protected String tabName; /** * States if the controller currently has records assigned to it @@ -98,9 +98,9 @@ public virtual with sharing class AbstractRedirectToLwcTabController */ public PageReference redirectToTab() { - Contract.requires( this.tabPageName != null, 'redirectToTab called with a null this.tabPageName. Ensure that the controller extension ('+ObjectUtils.getClassName( this )+') sets "this.tabPageName" in the constructor' ); + Contract.requires( this.tabName != null, 'redirectToTab called with a null this.tabName. Ensure that the controller extension ('+ObjectUtils.getClassName( this )+') sets "this.tabName" in the constructor' ); - PageReference appPage = new PageReference( '/lightning/n/' + this.tabPageName ); + PageReference appPage = new PageReference( '/lightning/n/' + this.tabName ); appPage.getParameters().put( 'c__returnUrl', returnUrl ); appPage.getParameters().put( 'c__epoch', epochTime ); appPage.getParameters().put( 'c__recordIds', serializedRecordIds ); diff --git a/framework/default/ortoo-lwc-list-view-buttons/classes/tests/AbstractRedirectToLwcTabControllerTest.cls b/framework/default/ortoo-lwc-list-view-buttons/classes/tests/AbstractRedirectToLwcTabControllerTest.cls index 46a109af840..b821aa24070 100644 --- a/framework/default/ortoo-lwc-list-view-buttons/classes/tests/AbstractRedirectToLwcTabControllerTest.cls +++ b/framework/default/ortoo-lwc-list-view-buttons/classes/tests/AbstractRedirectToLwcTabControllerTest.cls @@ -1,5 +1,5 @@ @isTest -public with sharing class AbstractRedirectToLwcTabControllerTest +public with sharing class AbstractRedirectToLwcTabControllerTest { @isTest private static void hasRecords_whenRecordsAreSelected_returnsTrue() // NOPMD: Test method name format @@ -12,7 +12,7 @@ public with sharing class AbstractRedirectToLwcTabControllerTest ApexPages.StandardSetController standardSetController = new ApexPages.StandardSetController( context ); standardSetController.setSelected( context ); - TestableRedirectToLwcTabPageController controller = new TestableRedirectToLwcTabPageController( standardSetController ); + TestableRedirectToLwcTabController controller = new TestableRedirectToLwcTabController( standardSetController ); Test.startTest(); Boolean got = controller.hasRecords; @@ -32,7 +32,7 @@ public with sharing class AbstractRedirectToLwcTabControllerTest ApexPages.StandardSetController standardSetController = new ApexPages.StandardSetController( context ); standardSetController.setSelected( new List() ); - TestableRedirectToLwcTabPageController controller = new TestableRedirectToLwcTabPageController( standardSetController ); + TestableRedirectToLwcTabController controller = new TestableRedirectToLwcTabController( standardSetController ); Test.startTest(); Boolean got = controller.hasRecords; @@ -54,13 +54,13 @@ public with sharing class AbstractRedirectToLwcTabControllerTest ApexPages.StandardSetController standardSetController = new ApexPages.StandardSetController( context ); standardSetController.setSelected( context ); - TestableRedirectToLwcTabPageController controller = new TestableRedirectToLwcTabPageController( standardSetController ); + TestableRedirectToLwcTabController controller = new TestableRedirectToLwcTabController( standardSetController ); Test.startTest(); PageReference got = controller.redirectToTab(); Test.stopTest(); - Amoss_Asserts.assertContains( 'tabpagename', got.getUrl(), 'redirectToTab, when called, will retrun a PageReference with the URL pointing to the defined tab page' ); + Amoss_Asserts.assertContains( 'tabName', got.getUrl(), 'redirectToTab, when called, will retrun a PageReference with the URL pointing to the defined tab page' ); Map parameters = got.getParameters(); System.assertEquals( 'testscenario', parameters.get( 'c__returnUrl' ), 'redirectToTab, when called, will return a PageReference with a return url parameter' ); @@ -81,13 +81,13 @@ public with sharing class AbstractRedirectToLwcTabControllerTest ApexPages.StandardSetController standardSetController = new ApexPages.StandardSetController( context ); standardSetController.setSelected( new List() ); - TestableRedirectToLwcTabPageController controller = new TestableRedirectToLwcTabPageController( standardSetController ); + TestableRedirectToLwcTabController controller = new TestableRedirectToLwcTabController( standardSetController ); Test.startTest(); PageReference got = controller.redirectToTab(); Test.stopTest(); - Amoss_Asserts.assertContains( 'tabpagename', got.getUrl(), 'redirectToTab, when no records are selected, will retrun a PageReference with the URL pointing to the defined tab page' ); + Amoss_Asserts.assertContains( 'tabName', got.getUrl(), 'redirectToTab, when no records are selected, will retrun a PageReference with the URL pointing to the defined tab page' ); Map parameters = got.getParameters(); System.assertEquals( 'testscenario', parameters.get( 'c__returnUrl' ), 'redirectToTab, when no records are selected, will return a PageReference with a return url parameter' ); @@ -95,12 +95,12 @@ public with sharing class AbstractRedirectToLwcTabControllerTest System.assertEquals( expectedRecordIds, parameters.get( 'c__recordIds' ), 'redirectToTab, when no records are selected, will return a PageReference with a record ids parameter that contains a serialised empty list' ); } - class TestableRedirectToLwcTabPageController extends AbstractRedirectToLwcTabController + class TestableRedirectToLwcTabController extends AbstractRedirectToLwcTabController { - public TestableRedirectToLwcTabPageController( ApexPages.StandardSetController controller ) + public TestableRedirectToLwcTabController( ApexPages.StandardSetController controller ) { super( controller ); - this.tabPageName = 'tabpagename'; + this.tabName = 'tabName'; } } }