2121public class NewVersionTest extends AbstractCleanupTest
2222{
2323 private static final String BACKTICK_PASSWORD = "``````" ;
24-
2524 private static final String SORTING = "datemodified" ;
26-
2725 private static final String ADMIN_USERNAME = "admin" ;
28-
2926 private static final String FIRST_MODERATOR_USERNAME = "SimpleModerator" ;
30-
3127 private static final String SECOND_MODERATOR_USERNAME = "SecondStepModerator" ;
28+ private static final String STEP_NAME_ONE = "moderation step 1" ;
29+ private static final String STEP_NAME_TWO = "moderation step 2" ;
3230
3331 public NewVersionTest ()
3432 {
@@ -43,12 +41,12 @@ public void newVersion()
4341 WizardPageTab wizard = new ContributePage (context ).load ().openWizard ("Move to Live During Moderation" );
4442 String itemFullName = context .getFullName ("item" );
4543 String itemFullName2 = itemFullName + " 2" ;
46- saveItem (wizard ,1 , itemFullName );
44+ saveItem (wizard , 1 , itemFullName );
4745 logout ();
4846
4947 // Login as SimpleModerator and moderate the item at the first step.
5048 logon (FIRST_MODERATOR_USERNAME , BACKTICK_PASSWORD );
51- doModeration ( FIRST_MODERATOR_USERNAME , BACKTICK_PASSWORD , "moderation step 1" , itemFullName , false );
49+ doModeration (FIRST_MODERATOR_USERNAME , BACKTICK_PASSWORD , STEP_NAME_ONE , itemFullName , false );
5250 logout ();
5351
5452 //login as admin to validate that we can't create a new version while an item is still under moderation
@@ -62,19 +60,19 @@ public void newVersion()
6260 alert .accept ();
6361 alertDisplayed = true ;
6462 }
65- assertTrue ( alertDisplayed , "Failed to trigger check of new version not allowed when already version in moderation." );
63+ assertTrue (alertDisplayed , "Failed to trigger check of new version not allowed when already version in moderation." );
6664 logout ();
6765
6866 // Login as the SecondStepModerator and moderate again because this workflow needs moderating twice.
6967 logon (SECOND_MODERATOR_USERNAME , BACKTICK_PASSWORD );
70- doModeration ( SECOND_MODERATOR_USERNAME , BACKTICK_PASSWORD , "moderation step 2" , itemFullName , false );
68+ doModeration (SECOND_MODERATOR_USERNAME , BACKTICK_PASSWORD , STEP_NAME_TWO , itemFullName , false );
7169 logout ();
7270
7371 // Now the item should be in a state where we're allowed to create a new version.
7472 // login as admin and new version it.
7573 logon (ADMIN_USERNAME , BACKTICK_PASSWORD );
7674 wizard = SearchPage .searchAndView (context , itemFullName ).adminTab ().newVersion ();
77- saveItem (wizard ,1 , itemFullName2 );
75+ saveItem (wizard , 1 , itemFullName2 );
7876 // check that there is a version that is live, and one that is moderating.
7977 ItemListPage itemList = getItemList (itemFullName );
8078 assertEquals (itemList .getResultForTitle (itemFullName , 1 ).getStatus (), "live" );
@@ -83,7 +81,7 @@ public void newVersion()
8381
8482 // Login as SimpleModerator and moderate the new version of this item at the first step.
8583 logon (FIRST_MODERATOR_USERNAME , BACKTICK_PASSWORD );
86- doModeration (FIRST_MODERATOR_USERNAME , BACKTICK_PASSWORD , "moderation step 1" , itemFullName2 ,false );
84+ doModeration (FIRST_MODERATOR_USERNAME , BACKTICK_PASSWORD , STEP_NAME_ONE , itemFullName2 ,false );
8785 // After moderation, check that the item has gone life after the first moderation step
8886 itemList = getItemList (itemFullName2 );
8987 assertEquals (itemList .getResultForTitle (itemFullName2 , 1 ).getStatus (), "live" );
@@ -96,12 +94,12 @@ public void newVersion()
9694 logout ();
9795 }
9896
99- private void doModeration ( String username , String password , String stepName , String itemFullName , Boolean lastModeration ) {
97+ private void doModeration (String username , String password , String stepName , String itemFullName , Boolean lastModeration ) {
10098 TaskListPage taskListPage = new TaskListPage (context ).load ();
10199 ModerateListSearchResults modResults = taskListPage .exactQuery (itemFullName );
102100 if (!lastModeration )
103101 {
104- assertEquals (modResults .getStepName (itemFullName ), stepName );
102+ assertEquals (modResults .getStepName (itemFullName ), stepName );
105103 modResults .moderate (itemFullName ).accept ();
106104 }
107105 else
0 commit comments