Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5725a20
Bump org.apache.maven.plugins:maven-dependency-plugin (#6)
dependabot[bot] Feb 11, 2026
3b78399
Bump org.junit.jupiter:junit-jupiter in the maven-deps group (#13)
dependabot[bot] Feb 18, 2026
427ca1c
Add test for default statusCode in HttpResponse
eafalkens Feb 19, 2026
fb5b5da
Add test for setting statusCode in HttpResponse
eafalkens Feb 19, 2026
89bfc44
Add test for default statusText in HttpResponse
eafalkens Feb 19, 2026
e0761cd
Add test for setting statusText in HttpResponse
eafalkens Feb 19, 2026
b1618b2
Add test for deafult empty header in HttpResponse
eafalkens Feb 19, 2026
743a6e5
Add test for setting header in HttpResponse
eafalkens Feb 19, 2026
f28f3a0
Add test for default empty body in HttpResponse
eafalkens Feb 19, 2026
e71b1d7
Add test for setting body in HttpResponse
eafalkens Feb 19, 2026
4bd580e
Add test for NullPointerException when setting null statusText
eafalkens Feb 19, 2026
69fafc6
Clean up HttpResponseTests; keep defaults and validation, remove
eafalkens Feb 23, 2026
5a0fead
Refactor HttpResponseTest to CodeRabbit changes
eafalkens Feb 23, 2026
052d32c
Merge branch 'main' into test/HttpResponse
eafalkens Feb 23, 2026
04addf4
Fix HttpResponseTest
eafalkens Feb 23, 2026
d924bfe
Trigger CI
eafalkens Feb 23, 2026
3d72223
Fix HttpResponseTest
eafalkens Feb 23, 2026
50bf1a1
Merge branch 'test/HttpResponse'
eafalkens Feb 23, 2026
5f18f91
Bump the maven-deps group with 2 updates (#21)
dependabot[bot] Feb 25, 2026
bc28a4e
Merge remote-tracking branch 'origin/main'
eafalkens Feb 26, 2026
6d84d6b
Add test for empty statusText in HttpResponse and remove null test
eafalkens Mar 1, 2026
2cdf3a1
Resolve merging conflict in pom.xml
eafalkens Mar 1, 2026
93f94c6
Merge branch 'main' into bug/test-errors
eafalkens Mar 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
191 changes: 24 additions & 167 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,16 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.juv25d</groupId>
<artifactId>JavaHttpServer</artifactId>
<groupId>org.example</groupId>
<artifactId>JavaTemplate</artifactId>
Comment thread
eafalkens marked this conversation as resolved.
<version>1.0-SNAPSHOT</version>

<scm>
<connection>scm:git:https://github.com/ithsjava25/project-webserver-juv25d.git</connection>
<developerConnection>scm:git:https://github.com/ithsjava25/project-webserver-juv25d.git</developerConnection>
<url>https://github.com/ithsjava25/project-webserver-juv25d</url>
<tag>HEAD</tag>
</scm>

<properties>
<maven.compiler.release>25</maven.compiler.release>
<maven.compiler.release>23</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.jupiter.version>6.0.2</junit.jupiter.version>
<junit.jupiter.version>6.0.3</junit.jupiter.version>
<assertj.core.version>3.27.7</assertj.core.version>
<mockito.version>5.21.0</mockito.version>
<errorprone.version>2.45.0</errorprone.version>
<nullaway.version>0.13.1</nullaway.version>
<build.time>${maven.build.timestamp}</build.time>
<argLine/>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -97,71 +86,46 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.15.0</version>
<configuration>
<fork>true</fork>
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
<arg>-Xplugin:ErrorProne -Xep:NullAway:ERROR -XepOpt:NullAway:AnnotatedPackages=org.juv25d</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>${errorprone.version}</version>
</path>
<path>
<groupId>com.uber.nullaway</groupId>
<artifactId>nullaway</artifactId>
<version>${nullaway.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.4.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.9.0</version>
<executions>
<execution>
<goals>
<goal>properties</goal>
</goals>
</execution>
</executions>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.10.0</version>
<executions>
<execution>
<goals>
<goal>properties</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.4</version>
<configuration>
<argLine>@{argLine} -Xshare:off</argLine>
</configuration>
<version>3.5.5</version>
<configuration>
<argLine>@{argLine} -javaagent:${org.mockito:mockito-core:jar} -Xshare:off</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.4</version>
<version>3.5.5</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -194,113 +158,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>3.2.1</version>
<configuration>
<java>
<includes>
<include>src/main/java/**/*.java</include>
<include>src/test/java/**/*.java</include>
</includes>

<removeUnusedImports />
<trimTrailingWhitespace />
<formatAnnotations />
</java>
</configuration>
</plugin>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.22.0</version>

<dependencies>
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-junit5-plugin</artifactId>
<version>1.2.2</version>
</dependency>
</dependencies>

<configuration>
<targetClasses>
<param>org.juv25d.*</param>
</targetClasses>
<targetTests>
<param>org.juv25d.*</param>
</targetTests>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<shortRevisionLength>7</shortRevisionLength>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>app</finalName>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.juv25d.App</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources-filtered</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
21 changes: 18 additions & 3 deletions src/test/java/org/juv25d/http/HttpResponseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,22 @@

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.*;

class HttpResponseTest {
import static org.junit.jupiter.api.Assertions.*;

public class HttpResponseTest {

private HttpResponse response;

@BeforeEach
void setUp() {
response = new HttpResponse();
}

@Test
void shouldReturnDefaultStatusCode() {
assertEquals(200, response.statusCode());
}

private HttpResponse response;

Expand All @@ -28,6 +41,8 @@ void setHeader_setsEntry_andDoesNotThrow() {
assertThatCode(() -> response.setHeader("Content-Type", "text/plain"))
.doesNotThrowAnyException();

assertThat(response.headers()).containsEntry("Content-Type", "text/plain");
@Test
void shouldHaveEmptyBodyByDefault() {
assertArrayEquals(new byte[0], response.body());
}
}
1 change: 0 additions & 1 deletion src/test/java/org/juv25d/http/HttpResponseWriterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,4 @@ void writes404HeadResponse() throws Exception {
assertThat(result).endsWith("\r\n\r\n");
assertThat(result).doesNotContain("Not found");
}

}
Loading