-
Notifications
You must be signed in to change notification settings - Fork 2
Add unit tests for HttpResponse #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 42 commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
f416823
Create CI pipeline and mvn wrapper (#3)
fmazmz 2bb8152
add docker release workflow for publishing docker image to ghcr (#8)
fmazmz b86eb38
create initial DockerFile (#9)
fmazmz 1f93012
Feature/tcp serversocket #4 (#10)
kristinaxm 70db6c7
chore: Update POM to Java 25 and rename artifactId/groupId (#11)
kristinaxm bf031de
feature/HTTPparser (#12)
LinusWestling 06d3f0c
feature/ServerLogging (#22)
addee1 68b5341
update POM with pitest (#26)
kristinaxm e0c324c
Add basic HTTP response support (#24)
addee1 019e4c4
Fix PiTest by defining argLine and removing invalid Mockito javaagent…
kristinaxm 7815c6b
Rename SocketServer to Server Move HTTP request handling logic to a d…
johanbriger b0d7583
Add testing for ServerLogging.java. Configure ServerLogging.java for …
bamsemats 446b5e9
feature/FilterPlugin (#17)
LinusWestling 410ff28
Introduce ADR structure and first ADR - Add ADR README explaining the…
annikaholmqvist94 d6080ff
feat: make HttpResponse mutable and implement NotFoundPlugin default …
LinusWestling d9fa188
Implement static file handler (foundation for #18) (#36)
annikaholmqvist94 57f52cb
bump pom version for release (#57)
fmazmz b088497
Create release tag v1.0.0-beta (#58)
fmazmz 1ac03c5
Adds unit tests to HttpParser (#42)
simonforsberg 418f1ad
add application properties and a ConfigLoader to load set configurati…
fmazmz ef181c0
Feature/global filter (#51)
kristinaxm fb5ae28
Add IP filter to request pipeline (#59)
HerrKanin 0d42601
Update websit to include nav bar, readme site and load content from r…
bamsemats 9823160
docs: centralize documentation into root README and remove package-le…
addee1 b716a70
Update to fix yaml error in pom and README.md content (#65)
bamsemats 48d88db
Feature/routing separate from plugin (#68)
bamsemats af32a5d
feat: add filter scope annotations (@Global, @Route) (#67)
kristinaxm 3377579
Feat/testing the full image before publishing (#84)
TatjanaTrajkovic 7e5ce75
add .dockerignore to optimize and speed up Docker build (#86)
TatjanaTrajkovic 97381b0
Feature: Rate Limiting Filter (#83)
simonforsberg 46352c8
Add URL redirect filter (301/302) (#64)
annikaholmqvist94 eede595
bug: IOException due to non existant source mapping url (#80)
fmazmz 3d11a7c
implement securityheadersfilter to harden http responses (#91)
johanbriger 74de92e
Added IpFilterTest class with unit test verifying IpFilter allows whi…
SandraNelj 427ca1c
Add test for default statusCode in HttpResponse
eafalkens fb5b5da
Add test for setting statusCode in HttpResponse
eafalkens 89bfc44
Add test for default statusText in HttpResponse
eafalkens e0761cd
Add test for setting statusText in HttpResponse
eafalkens b1618b2
Add test for deafult empty header in HttpResponse
eafalkens 743a6e5
Add test for setting header in HttpResponse
eafalkens f28f3a0
Add test for default empty body in HttpResponse
eafalkens e71b1d7
Add test for setting body in HttpResponse
eafalkens 4bd580e
Add test for NullPointerException when setting null statusText
eafalkens f136e93
Refactor ConfigLoader to accept InputStream and add unit tests (#72)
lindaeskilsson 997b771
Initialize safe defaults in HttpResponse no-arg constructorFix/httpre…
lindaeskilsson 7556101
Align rate-limiting configuration with Server and Logging in ConfigLo…
mattknatt 251a3a8
applied order filter annotations to existing filters (#107)
kristinaxm 8b2b644
Feature/health check plugin + Metric Plugin (#105)
bamsemats 831901b
Add filter for measuring request response time (#101)
Cavve 69fafc6
Clean up HttpResponseTests; keep defaults and validation, remove
eafalkens 5a0fead
Refactor HttpResponseTest to CodeRabbit changes
eafalkens 052d32c
Merge branch 'main' into test/HttpResponse
eafalkens 04addf4
Fix HttpResponseTest
eafalkens d924bfe
Trigger CI
eafalkens 3d72223
Fix HttpResponseTest
eafalkens 0a46b1f
Adds a connection id to an incoming request that is included in all …
Tyreviel 9ae1672
Add ETag support to StaticFileHandler with caching for static files (…
OskarLundqvist33 bd127df
allow using both white and blacklist at the same time with a configur…
jesperlarsson1910 76aff08
Feature/core di architecture (#114)
kristinaxm 1167331
Route forwarding server proxy (#119)
fmazmz 7453592
split app into layers for more efficent building (#112)
jesperlarsson1910 012e67d
Merge remote-tracking branch 'origin/main' into test/HttpResponse
eafalkens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| target/ | ||
| .git/ | ||
| .mvn/ | ||
| mvnw | ||
| mvnw.cmd | ||
| .editorconfig | ||
| .gitignore | ||
| *.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| indent_style = space | ||
| indent_size = 4 | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true | ||
|
|
||
| [*.yml] | ||
| indent_size = 2 | ||
|
|
||
| [*.yaml] | ||
| indent_size = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: CI Pipeline | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| pull_request: | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup Java 25 | ||
| uses: actions/setup-java@v5.2.0 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '25' | ||
| cache: 'maven' | ||
|
|
||
| - name: Run tests | ||
| run: ./mvnw -B test | ||
|
|
||
| - name: Run spotless checks | ||
| run: ./mvnw -B spotless:check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: Publish Docker Image | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Checkout repo | ||
| uses: actions/checkout@v6.0.2 | ||
|
|
||
| - name: Setup QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Setup Docker BuildX | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Login to GHCR | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Extract Docker metadata | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ghcr.io/${{ github.repository_owner }}/project-webserver-juv25d | ||
| tags: type=ref,event=tag | ||
| labels: org.opencontainers.image.source=${{ github.repository }} | ||
|
|
||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| push: true | ||
| platforms: linux/amd64,linux/arm64 | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| target/ | ||
| /.idea/ | ||
| /META-INF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| wrapperVersion=3.3.4 | ||
| distributionType=only-script | ||
| distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.7/apache-maven-3.8.7-bin.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| FROM maven:3.9-eclipse-temurin-25 AS build | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY pom.xml pom.xml | ||
| RUN mvn dependency:go-offline -B | ||
|
|
||
| COPY src ./src | ||
| RUN mvn clean package -DskipTests | ||
|
|
||
| FROM eclipse-temurin:25-jre-alpine | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # might need to update this later when we have our explicit class names | ||
| COPY --from=build /app/target/app.jar app.jar | ||
| ENTRYPOINT ["java", "-jar", "app.jar"] | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run the container as a non-root user.
The runtime stage has no
USERinstruction, so the JVM process runs as root inside the container. The official eclipse-temurin docs confirm that containers can be run with a non-root UID, noting that restricted environments like Red Hat OpenShift do this by default. Add a dedicated system user before theENTRYPOINT:🔒 Proposed fix — add a non-root user
📝 Committable suggestion
🤖 Prompt for AI Agents