generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
deployment/src/test/java/io/quarkiverse/unleash/ClientRegisteredUnleashSubscriber.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,23 @@ | ||
package io.quarkiverse.unleash; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
|
||
import io.getunleash.event.UnleashSubscriber; | ||
import io.getunleash.metric.ClientRegistration; | ||
import io.quarkus.arc.Unremovable; | ||
|
||
@ApplicationScoped | ||
@Unremovable | ||
public class ClientRegisteredUnleashSubscriber implements UnleashSubscriber { | ||
|
||
private boolean clientRegistered; | ||
|
||
@Override | ||
public void clientRegistered(ClientRegistration clientRegistration) { | ||
clientRegistered = true; | ||
} | ||
|
||
public boolean isClientRegistered() { | ||
return clientRegistered; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
deployment/src/test/java/io/quarkiverse/unleash/UnleashSubscriberTest.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,25 @@ | ||
package io.quarkiverse.unleash; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import jakarta.inject.Inject; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class UnleashSubscriberTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest TEST = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar.addClasses(ClientRegisteredUnleashSubscriber.class)); | ||
|
||
@Inject | ||
ClientRegisteredUnleashSubscriber unleashSubscriber; | ||
|
||
@Test | ||
void test() { | ||
assertTrue(unleashSubscriber.isClientRegistered()); | ||
} | ||
} |
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