Skip to content

Commit 063b650

Browse files
author
Julian Kast
committed
Make VoiceCommandChangesListener package privet for unit Test, and fix broken test
1 parent 44ec539 commit 063b650

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManagerTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import com.smartdevicelink.managers.CompletionListener;
4040
import com.smartdevicelink.managers.ISdl;
4141
import com.smartdevicelink.protocol.enums.FunctionID;
42+
import com.smartdevicelink.proxy.RPCRequest;
4243
import com.smartdevicelink.proxy.rpc.OnCommand;
4344
import com.smartdevicelink.proxy.rpc.OnHMIStatus;
4445
import com.smartdevicelink.proxy.rpc.enums.HMILevel;
@@ -55,6 +56,7 @@
5556
import java.util.ArrayList;
5657
import java.util.Arrays;
5758
import java.util.Collections;
59+
import java.util.HashMap;
5860
import java.util.List;
5961

6062
import static junit.framework.TestCase.assertEquals;
@@ -175,6 +177,8 @@ public void testHMINotReady() {
175177
public void testUpdatingCommands() {
176178
// Send a new single command, and test that its listener works, as it gets called from the VCM
177179
voiceCommandManager.setVoiceCommands(Collections.singletonList(command3));
180+
HashMap<RPCRequest, String> errorObject = new HashMap<>();
181+
voiceCommandManager.updateOperation.voiceCommandListener.updateVoiceCommands(voiceCommandManager.voiceCommands, errorObject);
178182

179183
// Fake onCommand - we want to make sure that we can pass back onCommand events to our VoiceCommand Objects
180184
OnCommand onCommand = new OnCommand();

base/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandUpdateOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class VoiceCommandUpdateOperation extends Task {
2222
private List<VoiceCommand> pendingVoiceCommands;
2323
private List<DeleteCommand> deleteVoiceCommands;
2424
private List<AddCommand> addCommandsToSend;
25-
private VoiceCommandChangesListener voiceCommandListener;
25+
VoiceCommandChangesListener voiceCommandListener;
2626
private List<VoiceCommand> currentVoiceCommands;
2727
private HashMap<RPCRequest, String> errorObject;
2828

0 commit comments

Comments
 (0)