[fix]:[添加java测试代码]
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
kale 2025-12-05 05:16:36 -05:00
parent edbc7fe0de
commit 6bf8a382d8
3 changed files with 21 additions and 0 deletions

View File

@ -11,4 +11,12 @@
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>
</properties> </properties>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.12.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</project> </project>

View File

@ -4,5 +4,10 @@ public class App {
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("Hello, World!"); System.out.println("Hello, World!");
} }
public String greet() {
return "Hello, World!";
}
} }

View File

@ -0,0 +1,8 @@
package com.example;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
public class AppTest {
@Test public void testGreet() { App app = new App(); assertEquals("Hello, World!", app.greet()); }
}