-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disable producing a Guard/TypedGuard with an identifier of "global"
This is to avoid a possible future collision when configuration will apply to beans of type `Guard` / `TypedGuard`.
- Loading branch information
Showing
6 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
14 changes: 14 additions & 0 deletions
14
.../test/java/io/smallrye/faulttolerance/reuse/errors/GuardWithIdentifierGlobalProducer.java
This file contains 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,14 @@ | ||
package io.smallrye.faulttolerance.reuse.errors; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.enterprise.inject.Produces; | ||
|
||
import io.smallrye.common.annotation.Identifier; | ||
import io.smallrye.faulttolerance.api.Guard; | ||
|
||
@ApplicationScoped | ||
public class GuardWithIdentifierGlobalProducer { | ||
@Produces | ||
@Identifier("global") | ||
public static Guard GUARD = Guard.create().build(); | ||
} |
16 changes: 16 additions & 0 deletions
16
.../src/test/java/io/smallrye/faulttolerance/reuse/errors/GuardWithIdentifierGlobalTest.java
This file contains 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,16 @@ | ||
package io.smallrye.faulttolerance.reuse.errors; | ||
|
||
import jakarta.enterprise.inject.spi.DefinitionException; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.smallrye.faulttolerance.util.ExpectedDeploymentException; | ||
import io.smallrye.faulttolerance.util.FaultToleranceBasicTest; | ||
|
||
@FaultToleranceBasicTest | ||
@ExpectedDeploymentException(DefinitionException.class) | ||
public class GuardWithIdentifierGlobalTest { | ||
@Test | ||
public void test(GuardWithIdentifierGlobalProducer ignored) { | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
.../java/io/smallrye/faulttolerance/reuse/errors/TypedGuardWithIdentifierGlobalProducer.java
This file contains 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,14 @@ | ||
package io.smallrye.faulttolerance.reuse.errors; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.enterprise.inject.Produces; | ||
|
||
import io.smallrye.common.annotation.Identifier; | ||
import io.smallrye.faulttolerance.api.TypedGuard; | ||
|
||
@ApplicationScoped | ||
public class TypedGuardWithIdentifierGlobalProducer { | ||
@Produces | ||
@Identifier("global") | ||
public static TypedGuard<String> GUARD = TypedGuard.create(String.class).build(); | ||
} |
16 changes: 16 additions & 0 deletions
16
...test/java/io/smallrye/faulttolerance/reuse/errors/TypedGuardWithIdentifierGlobalTest.java
This file contains 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,16 @@ | ||
package io.smallrye.faulttolerance.reuse.errors; | ||
|
||
import jakarta.enterprise.inject.spi.DefinitionException; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.smallrye.faulttolerance.util.ExpectedDeploymentException; | ||
import io.smallrye.faulttolerance.util.FaultToleranceBasicTest; | ||
|
||
@FaultToleranceBasicTest | ||
@ExpectedDeploymentException(DefinitionException.class) | ||
public class TypedGuardWithIdentifierGlobalTest { | ||
@Test | ||
public void test(TypedGuardWithIdentifierGlobalProducer ignored) { | ||
} | ||
} |