generated from micronaut-projects/micronaut-project-template
-
Notifications
You must be signed in to change notification settings - Fork 14
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
8 changed files
with
105 additions
and
8 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
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
34 changes: 34 additions & 0 deletions
34
.../src/test/groovy/io/micronaut/oraclecloud/monitoring/sdk/MonitorRegionProviderSpec.groovy
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,34 @@ | ||
package io.micronaut.oraclecloud.monitoring.sdk | ||
|
||
import com.oracle.bmc.Region | ||
import com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider | ||
import com.oracle.bmc.monitoring.Monitoring | ||
import com.oracle.bmc.monitoring.MonitoringClient | ||
import io.micronaut.context.annotation.Property | ||
import io.micronaut.context.annotation.Requires | ||
import io.micronaut.test.extensions.spock.annotation.MicronautTest | ||
import jakarta.inject.Inject | ||
import org.junit.jupiter.api.Assertions | ||
import spock.lang.Specification | ||
|
||
@MicronautTest(startApplication = false) | ||
@Property(name = "spec.name", value = "MonitorRegionProviderSpec") | ||
@Property(name = "micronaut.metrics.export.oraclecloud.enabled", value = "false") | ||
@Property(name = "oci.vault.config.enabled", value = "false") | ||
@Property(name = "micronaut.config-client.enabled", value = "false") | ||
@Property(name = "datasources.enabled", value = "false") | ||
@Requires(bean = AbstractAuthenticationDetailsProvider.class) | ||
class MonitorRegionProviderSpec extends Specification { | ||
|
||
@Inject | ||
Monitoring monitoring | ||
|
||
void 'test the' () { | ||
when: | ||
String endpoint = monitoring.getEndpoint() | ||
|
||
then: | ||
Region.EU_JOVANOVAC_1.getEndpoint(MonitoringClient.SERVICE).get() == endpoint | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
...eter/src/test/groovy/io/micronaut/oraclecloud/monitoring/sdk/VaultRegionProviderMock.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,21 @@ | ||
package io.micronaut.oraclecloud.monitoring.sdk; | ||
|
||
import com.oracle.bmc.Region; | ||
import com.oracle.bmc.auth.RegionProvider; | ||
import io.micronaut.context.annotation.BootstrapContextCompatible; | ||
import io.micronaut.context.annotation.Primary; | ||
import io.micronaut.context.annotation.Property; | ||
import io.micronaut.context.annotation.Replaces; | ||
import io.micronaut.context.annotation.Requires; | ||
import jakarta.inject.Singleton; | ||
|
||
@Replaces(RegionProvider.class) | ||
@BootstrapContextCompatible | ||
@Singleton | ||
@Requires(property = "spec.name", value = "MonitorRegionProviderSpec") | ||
public class VaultRegionProviderMock implements RegionProvider { | ||
@Override | ||
public Region getRegion() { | ||
return Region.EU_JOVANOVAC_1; | ||
} | ||
} |
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