diff --git a/app/pom.xml b/app/pom.xml index 7258f0f0..fbba3eaa 100644 --- a/app/pom.xml +++ b/app/pom.xml @@ -38,17 +38,17 @@ com.talkforgeai backend - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT com.talkforgeai frontend - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT com.talkforgeai service - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT diff --git a/backend/pom.xml b/backend/pom.xml index 18277afc..0dc1fbc9 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -32,7 +32,12 @@ com.talkforgeai service - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT + + + + net.sourceforge.plantuml + plantuml diff --git a/backend/src/main/java/com/talkforgeai/backend/util/StringUtils.java b/backend/src/main/java/com/talkforgeai/backend/util/StringUtils.java index cc3d9862..1ef2f5f1 100644 --- a/backend/src/main/java/com/talkforgeai/backend/util/StringUtils.java +++ b/backend/src/main/java/com/talkforgeai/backend/util/StringUtils.java @@ -18,7 +18,7 @@ public class StringUtils { public static String maxLengthString(String input, int maxLength) { - if (maxLength < 0) { + if (input == null || maxLength < 0) { return ""; } return input.substring(0, Math.min(input.length(), maxLength)); diff --git a/backend/src/test/java/com/talkforgeai/backend/TalkforgeaiServerApplicationTests.java b/backend/src/test/java/com/talkforgeai/backend/TalkforgeaiServerApplicationTests.java deleted file mode 100644 index 17de96e9..00000000 --- a/backend/src/test/java/com/talkforgeai/backend/TalkforgeaiServerApplicationTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2023 Jean Schmitz. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.talkforgeai.backend; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest(classes = TestApplication.class) -class TalkforgeaiServerApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/backend/src/test/java/com/talkforgeai/backend/transformers/CodeBlockTransformerTest.java b/backend/src/test/java/com/talkforgeai/backend/transformers/CodeBlockTransformerTest.java index ea9ff783..769d4ca7 100644 --- a/backend/src/test/java/com/talkforgeai/backend/transformers/CodeBlockTransformerTest.java +++ b/backend/src/test/java/com/talkforgeai/backend/transformers/CodeBlockTransformerTest.java @@ -47,14 +47,19 @@ public void codeBlockWithLangGetsTransformed() { "\n" + ""; - String expected = "Here's an example of how to use the \"Arrays.sort()\" method:\n" + - "\n" + - "
" +
-                "int[] numbers = { 5, 3, 9, 1, 7 };\n" +
-                "Arrays.sort(numbers);\n" +
-                "
\n" + - "\n" + - ""; + String expected = """ + Here's an example of how to use the "Arrays.sort()" method: + + +
+                  int[] numbers = { 5, 3, 9, 1, 7 };
+                Arrays.sort(numbers);
+                
+                
+ + + + """; CodeBlockTransformer transformer = new CodeBlockTransformer(); @@ -75,14 +80,19 @@ public void codeBlockWithoutLangGetsTransformed() { "\n" + ""; - String expected = "Here's an example of how to use the \"Arrays.sort()\" method:\n" + - "\n" + - "
" +
-                "int[] numbers = { 5, 3, 9, 1, 7 };\n" +
-                "Arrays.sort(numbers);\n" +
-                "
\n" + - "\n" + - ""; + String expected = """ + Here's an example of how to use the "Arrays.sort()" method: + + +
+                  int[] numbers = { 5, 3, 9, 1, 7 };
+                Arrays.sort(numbers);
+                
+                
+ + + + """; CodeBlockTransformer transformer = new CodeBlockTransformer();