Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Commit ccc1024

Browse files
committed
Make tests compatible with java 8 again
1 parent c24e78b commit ccc1024

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

service/src/test/java/com/theokanning/openai/service/ChatCompletionTest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.util.ArrayList;
1111
import java.util.HashMap;
1212
import java.util.List;
13+
import java.util.Collections;
1314

1415
import static org.junit.jupiter.api.Assertions.*;
1516

@@ -88,7 +89,7 @@ void streamChatCompletion() {
8889

8990
@Test
9091
void createChatCompletionWithFunctions() {
91-
final List<ChatFunction> functions = List.of(ChatFunction.builder()
92+
final List<ChatFunction> functions = Collections.singletonList(ChatFunction.builder()
9293
.name("get_weather")
9394
.description("Get the current weather in a given location")
9495
.executor(Weather.class, w -> new WeatherResponse(w.location, w.unit, 25, "sunny"))
@@ -150,7 +151,7 @@ void createChatCompletionWithFunctions() {
150151

151152
@Test
152153
void streamChatCompletionWithFunctions() {
153-
final List<ChatFunction> functions = List.of(ChatFunction.builder()
154+
final List<ChatFunction> functions = Collections.singletonList(ChatFunction.builder()
154155
.name("get_weather")
155156
.description("Get the current weather in a given location")
156157
.executor(Weather.class, w -> new WeatherResponse(w.location, w.unit, 25, "sunny"))

0 commit comments

Comments
 (0)