diff --git a/Makefile b/Makefile index 62dc4df..699964a 100644 --- a/Makefile +++ b/Makefile @@ -2,4 +2,7 @@ ut: mvn clean test -Punit-tests it: - mvn clean verify -Pintegration-tests \ No newline at end of file + mvn clean verify -Pintegration-tests + +build: + mvn clean test install -Punit-tests \ No newline at end of file diff --git a/README.md b/README.md index 0a5ac9b..b25b73c 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ A Java library (wrapper/binding) for [Ollama](https://github.com/jmorganca/ollam - [Installation](#installation) - [Demo APIs](#try-out-the-apis) - [API Spec](#api-spec) +- [Development](#development) - [Contributions](#get-involved) #### Requirements @@ -340,6 +341,26 @@ public class Main { Find the full `Javadoc` (API specifications) [here](https://amithkoujalgi.github.io/ollama4j/). +#### Development + +Build: + +```shell +make ut +``` + +Run unit tests: + +```shell +make ut +``` + +Run integration tests: + +```shell +make it +``` + #### Areas of improvement - [x] Use Java-naming conventions for attributes in the request/response models instead of the snake-case conventions. ( diff --git a/pom.xml b/pom.xml index 4dc4902..230e5e7 100644 --- a/pom.xml +++ b/pom.xml @@ -127,6 +127,7 @@ **/unittests/*.java + ${skipIntegrationTests} @@ -189,6 +190,7 @@ unit false + true @@ -196,6 +198,7 @@ integration true + false diff --git a/src/test/java/io/github/amithkoujalgi/ollama4j/integrationtests/TestRealAPIs.java b/src/test/java/io/github/amithkoujalgi/ollama4j/integrationtests/TestRealAPIs.java index 77f0633..146cc58 100644 --- a/src/test/java/io/github/amithkoujalgi/ollama4j/integrationtests/TestRealAPIs.java +++ b/src/test/java/io/github/amithkoujalgi/ollama4j/integrationtests/TestRealAPIs.java @@ -101,7 +101,7 @@ public class TestRealAPIs { String model = OllamaModelType.LLAMA2; String prompt = "some prompt text"; try { - when(ollamaAPI.ask(model, prompt)).thenReturn(new OllamaResult("", 0)); + when(ollamaAPI.ask(model, prompt)).thenReturn(new OllamaResult("", 0,200)); ollamaAPI.ask(model, prompt); verify(ollamaAPI, times(1)).ask(model, prompt); } catch (IOException | OllamaBaseException | InterruptedException e) {