Paul Kattenborn
11 months ago
2 changed files with 59 additions and 24 deletions
@ -1,24 +1,33 @@ |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
<groupId>org.progmethoden</groupId> |
|||
<artifactId>java-chat</artifactId> |
|||
<version>0.0.1-SNAPSHOT</version> |
|||
|
|||
<dependencies> |
|||
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson --> |
|||
<dependency> |
|||
<groupId>com.google.code.gson</groupId> |
|||
<artifactId>gson</artifactId> |
|||
<version>2.10.1</version> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.mockito</groupId> |
|||
<artifactId>mockito-core</artifactId> |
|||
<version>4.1.10</version> |
|||
<scope>test</scope> |
|||
</dependency> |
|||
|
|||
</dependencies> |
|||
|
|||
</project> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<properties> |
|||
<junit-jupiter-version>RELEASE</junit-jupiter-version> |
|||
</properties> |
|||
|
|||
<modelVersion>4.0.0</modelVersion> |
|||
<groupId>org.progmethoden</groupId> |
|||
<artifactId>java-chat</artifactId> |
|||
<version>0.0.1-SNAPSHOT</version> |
|||
|
|||
<dependencies> |
|||
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson --> |
|||
<dependency> |
|||
<groupId>com.google.code.gson</groupId> |
|||
<artifactId>gson</artifactId> |
|||
<version>2.10.1</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>junit</groupId> |
|||
<artifactId>junit</artifactId> |
|||
<version>4.13.2</version> |
|||
<scope>test</scope> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.junit.jupiter</groupId> |
|||
<artifactId>junit-jupiter</artifactId> |
|||
<version>${junit-jupiter-version}</version> |
|||
<scope>test</scope> |
|||
</dependency> |
|||
|
|||
</dependencies> |
|||
|
|||
</project> |
@ -0,0 +1,26 @@ |
|||
import static org.junit.jupiter.api.Assertions.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
import org.junit.jupiter.api.Test; |
|||
|
|||
class ChatServerTest { |
|||
|
|||
@Test |
|||
public void testConstructor() { |
|||
// Arrange |
|||
ChatServer chatServer = null; |
|||
|
|||
// Act |
|||
try { |
|||
chatServer = new ChatServer(1234); |
|||
} catch (Exception e) { |
|||
fail("Exception occurred: " + e.getMessage()); |
|||
} |
|||
|
|||
// Assert |
|||
assertNotNull(chatServer); |
|||
} |
|||
} |
|||
|
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue