@@ -469,7 +469,26 @@ public void testClearingMenu(){
469469 }
470470
471471 public void testSettingMenuWithEmptyVoiceCommands (){
472+ // Make sure we can send an empty menu with no issues
473+ // start fresh
474+ menuManager .oldMenuCells = null ;
475+ menuManager .menuCells = null ;
476+ menuManager .inProgressUpdate = null ;
477+ menuManager .waitingUpdateMenuCells = null ;
478+ menuManager .waitingOnHMIUpdate = false ;
479+
480+ MenuSelectionListener menuSelectionListener = mock (MenuSelectionListener .class );
472481
482+ MenuCell A = new MenuCell ("A" , null , Collections .EMPTY_LIST , menuSelectionListener );
483+
484+ menuManager .currentHMILevel = HMILevel .HMI_FULL ;
485+ List <MenuCell > newMenu = Collections .singletonList (A );
486+
487+ menuManager .setMenuCells (newMenu );
488+ assertEquals (menuManager .menuCells .get (0 ).getVoiceCommands (), Collections .EMPTY_LIST );
489+ }
490+
491+ public void testSettingMenuWithVoiceCommands (){
473492 // Make sure we can send an empty menu with no issues
474493 // start fresh
475494 menuManager .oldMenuCells = null ;
@@ -481,17 +500,15 @@ public void testSettingMenuWithEmptyVoiceCommands(){
481500
482501 MenuSelectionListener menuSelectionListener = mock (MenuSelectionListener .class );
483502
484- MenuCell A = new MenuCell ("A" , null , Collections .EMPTY_LIST , menuSelectionListener );
503+ List <String > voiceCommandList = Collections .singletonList ("Hello There" );
504+
505+ MenuCell A = new MenuCell ("A" , null , voiceCommandList , menuSelectionListener );
485506
486507 menuManager .currentHMILevel = HMILevel .HMI_FULL ;
487- // send new cells. They should set the old way
488- List <MenuCell > oldMenu = createDynamicMenu1 ();
489508 List <MenuCell > newMenu = Collections .singletonList (A );
490- menuManager .setMenuCells (oldMenu );
491- assertEquals (menuManager .menuCells .size (), 4 );
492509
493510 menuManager .setMenuCells (newMenu );
494- assertEquals (menuManager .menuCells .size (), 1 );
511+ assertEquals (menuManager .menuCells .get ( 0 ). getVoiceCommands (), voiceCommandList );
495512 }
496513
497514
0 commit comments