Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Properties;
Expand Down Expand Up @@ -167,6 +168,6 @@ public Scheduler getScheduler() {
@Override
public List<InterpreterCompletion> completion(String buf, int cursor,
InterpreterContext interpreterContext) {
return null;
return Collections.emptyList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@
package org.apache.zeppelin.file;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;

import java.util.List;
import java.util.Properties;

import org.apache.zeppelin.interpreter.InterpreterException;
import org.apache.zeppelin.interpreter.thrift.InterpreterCompletion;
import org.junit.jupiter.api.Test;

/**
Expand Down Expand Up @@ -178,4 +181,14 @@ void testComplexCommand() {
assertTrue(args.flags.contains('h'));
assertFalse(args.flags.contains('-'));
}

@Test
void testCompletionReturnsEmptyListInsteadOfNull() {
TestFileInterpreter interpreter = new TestFileInterpreter(new Properties());

List<InterpreterCompletion> completions = interpreter.completion("ls", 2, null);

assertNotNull(completions, "completion() should never return null");
assertTrue(completions.isEmpty(), "Default completion() should return an empty list");
}
}
Loading