Skip to content

Fix Jex Request-Scoped Context #789

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

Merged
merged 5 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: [11,17,21]
java_version: [21]
os: [ubuntu-latest]

steps:
Expand Down
4 changes: 2 additions & 2 deletions inject-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-http-api</artifactId>
<version>3.1</version>
<version>3.2</version>
<optional>true</optional>
<scope>provided</scope>
</dependency>
Expand All @@ -59,7 +59,7 @@
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-http-client</artifactId>
<version>3.1</version>
<version>3.2</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
final class RequestScope {

private static final String JEX_CONTEXT = "io.avaje.jex.Context";
private static final String JEX_CONTEXT = "io.avaje.jex.http.Context";
private static final String JAVALIN_CONTEXT = "io.javalin.http.Context";
private static final String HELIDON_REQ = "io.helidon.webserver.ServerRequest";
private static final String HELIDON_RES = "io.helidon.webserver.ServerResponse";
Expand Down
13 changes: 10 additions & 3 deletions inject-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,28 @@
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-http-api</artifactId>
<version>3.1</version>
<version>3.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-http-client</artifactId>
<version>3.1</version>
<version>3.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-jex</artifactId>
<version>2.5</version>
<version>3.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-jsonb</artifactId>
<version>3.2</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
package org.example.custom;

import io.avaje.inject.BeanEntry;
import io.avaje.inject.BeanScope;
import static java.util.stream.Collectors.toList;
import static org.assertj.core.api.Assertions.assertThat;

import java.util.List;
import java.util.Optional;

import org.example.MyCustomScope;
import org.example.coffee.CoffeeMaker;
import org.example.custom.loc.LocalExternal;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import java.util.List;
import java.util.Optional;

import static java.util.stream.Collectors.toList;
import static org.assertj.core.api.Assertions.assertThat;
import io.avaje.inject.BeanEntry;
import io.avaje.inject.BeanScope;

class CustomScopeTest {

Expand Down Expand Up @@ -80,7 +81,7 @@ void customScopeAll() {

// includes the 2 supplied beans
final List<BeanEntry> all = beanScope.all();
assertThat(all).hasSize(7);
assertThat(all).hasSize(8);

final CustomBean customBean = beanScope.get(CustomBean.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@


import io.avaje.http.api.Controller;
import io.avaje.jex.Context;

import io.avaje.jex.http.Context;
import jakarta.inject.Inject;

@Controller
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.example.request;

import io.avaje.inject.xtra.ApplicationScope;
import io.avaje.jex.Context;
import io.avaje.jex.http.Context;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

Expand Down