From 57be6b23cafd8d9aca43b4e6b1ca12ea063f5af1 Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Mon, 27 May 2024 06:12:58 +0000 Subject: [PATCH] feat : removes test case which doesnt adds context --- chatbot-ollama-springai/pom.xml | 5 ----- .../chatbot/ChatbotOllamaApplicationTests.java | 14 +------------- .../chatbot/TestChatbotOllamaApplication.java | 2 +- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/chatbot-ollama-springai/pom.xml b/chatbot-ollama-springai/pom.xml index 870077c..279e116 100644 --- a/chatbot-ollama-springai/pom.xml +++ b/chatbot-ollama-springai/pom.xml @@ -49,11 +49,6 @@ rest-assured test - - org.springframework.boot - spring-boot-testcontainers - test - org.springframework.ai spring-ai-spring-boot-testcontainers diff --git a/chatbot-ollama-springai/src/test/java/com/example/chatbot/ChatbotOllamaApplicationTests.java b/chatbot-ollama-springai/src/test/java/com/example/chatbot/ChatbotOllamaApplicationTests.java index cf449a8..c80deda 100644 --- a/chatbot-ollama-springai/src/test/java/com/example/chatbot/ChatbotOllamaApplicationTests.java +++ b/chatbot-ollama-springai/src/test/java/com/example/chatbot/ChatbotOllamaApplicationTests.java @@ -27,24 +27,12 @@ void setUp() { RestAssured.port = localServerPort; } - @Test - void contextLoads() { - given().contentType(ContentType.JSON) - .body(new AIChatRequest("Hello?")) - .when() - .post("/api/ai/chat") - .then() - .statusCode(HttpStatus.SC_OK) - .contentType(ContentType.JSON) - .body("answer", containsString("help")); - } - @Test void chat() { given().contentType(ContentType.JSON) .body( new AIChatRequest( - "As a cricketer, how many centuries did Sachin Tendulkar scored adding up both One Day International (ODI) and Test centuries ?")) + "As a cricketer, how many centuries did Sachin Tendulkar scored adding up both One Day International (ODI) and Test centuries ?")) .when() .post("/api/ai/chat") .then() diff --git a/chatbot-ollama-springai/src/test/java/com/example/chatbot/TestChatbotOllamaApplication.java b/chatbot-ollama-springai/src/test/java/com/example/chatbot/TestChatbotOllamaApplication.java index ec98aa6..043780d 100644 --- a/chatbot-ollama-springai/src/test/java/com/example/chatbot/TestChatbotOllamaApplication.java +++ b/chatbot-ollama-springai/src/test/java/com/example/chatbot/TestChatbotOllamaApplication.java @@ -21,7 +21,7 @@ OllamaContainer ollama() { @Bean @ServiceConnection ChromaDBContainer chromadb() { - return new ChromaDBContainer(DockerImageName.parse("chromadb/chroma:0.5.0")); + return new ChromaDBContainer(DockerImageName.parse("chromadb/chroma").withTag("0.5.0")); } public static void main(String[] args) {