-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #4156: Improves handling of empty or blank input for openai pro…
…cedures
- Loading branch information
1 parent
c686650
commit e86fa80
Showing
5 changed files
with
98 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,15 @@ | ||
package apoc.ml; | ||
|
||
import apoc.util.ExtendedTestUtil; | ||
import org.neo4j.graphdb.GraphDatabaseService; | ||
|
||
import java.util.Map; | ||
|
||
import static apoc.ml.MLUtil.ERROR_NULL_INPUT; | ||
import static apoc.util.TestUtil.testCall; | ||
import static org.junit.Assert.assertTrue; | ||
import static org.junit.Assert.fail; | ||
import static apoc.ml.MLUtil.*; | ||
|
||
public class MLTestUtil { | ||
|
||
public static void assertNullInputFails(GraphDatabaseService db, String query, Map<String, Object> params) { | ||
try { | ||
testCall(db, query, params, | ||
(row) -> fail("Should fail due to null input") | ||
); | ||
} catch (RuntimeException e) { | ||
String message = e.getMessage(); | ||
assertTrue("Current error message is: " + message, | ||
message.contains(ERROR_NULL_INPUT) | ||
); | ||
} | ||
ExtendedTestUtil.assertFails(db, query, params, ERROR_NULL_INPUT); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters