Commit 2588456a authored by Alok Joshi's avatar Alok Joshi
Browse files

remove retry policy for secret client

parents d0fed512 c824b057
Pipeline #56566 failed with stages
in 7 minutes and 52 seconds
......@@ -51,6 +51,7 @@ The following software have components provided under the terms of this license:
- JCIP Annotations under Apache License (from http://stephenc.github.com/jcip-annotations)
- JSON Small and Fast Parser (from https://repo1.maven.org/maven2/net/minidev/json-smart)
- JSON Web Token support for the JVM (from https://github.com/jwtk/jjwt)
- JSR107 API and SPI (from https://github.com/jsr107/jsr107spec)
- Jackson dataformat: CBOR (from http://github.com/FasterXML/jackson-dataformats-binary)
- Jackson dataformat: Smile (from http://github.com/FasterXML/jackson-dataformats-binary)
- Jackson datatype: JSR310 (from https://repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310)
......@@ -60,7 +61,7 @@ The following software have components provided under the terms of this license:
- Jackson module: JAXB-annotations (from http://github.com/FasterXML/jackson-module-jaxb-annotations)
- Jackson-annotations (from http://github.com/FasterXML/jackson)
- Jackson-core (from http://wiki.fasterxml.com/JacksonHome)
- Jackson-dataformat-XML (from http://wiki.fasterxml.com/JacksonExtensionXmlDataBinding)
- Jackson-dataformat-XML (from https://github.com/FasterXML/jackson-dataformat-xml)
- Jackson-dataformat-YAML (from https://github.com/FasterXML/jackson-dataformats-text)
- Jackson-module-parameter-names (from https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-parameter-names)
- Java Native Access (from https://repo1.maven.org/maven2/net/java/dev/jna/jna)
......@@ -79,8 +80,8 @@ The following software have components provided under the terms of this license:
- Lucene Grouping (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-grouping)
- Lucene Highlighter (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-highlighter)
- Lucene Join (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-join)
- Lucene Memory (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-backward-codecs)
- Lucene Memory (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-memory)
- Lucene Memory (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-backward-codecs)
- Lucene Miscellaneous (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-misc)
- Lucene Queries (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-queries)
- Lucene QueryParsers (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-queryparser)
......@@ -116,6 +117,8 @@ The following software have components provided under the terms of this license:
- Non-Blocking Reactive Foundation for the JVM (from https://github.com/reactor/reactor-core)
- OAuth 2.0 SDK with OpenID Connect extensions (from https://bitbucket.org/connect2id/oauth-2.0-sdk-with-openid-connect-extensions)
- Objenesis (from http://objenesis.org)
- OkHttp (from https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp)
- OkHttp Logging Interceptor (from https://repo1.maven.org/maven2/com/squareup/okhttp3/logging-interceptor)
- Okio (from https://github.com/square/okio/)
- OpenCensus (from https://github.com/census-instrumentation/opencensus-java)
- OpenCensus (from https://github.com/census-instrumentation/opencensus-java)
......@@ -124,21 +127,29 @@ The following software have components provided under the terms of this license:
- Reactive Streams Netty driver (from https://github.com/reactor/reactor-netty)
- Retrofit (from https://github.com/square/retrofit)
- SnakeYAML (from http://code.google.com/p/snakeyaml/)
- Spring AOP (from https://repo1.maven.org/maven2/org/springframework/spring-aop)
- Spring AOP (from https://github.com/spring-projects/spring-framework)
- Spring Beans (from https://github.com/spring-projects/spring-framework)
- Spring Boot AOP Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-aop)
- Spring Boot Actuator (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-actuator)
- Spring Boot Actuator AutoConfigure (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-actuator-autoconfigure)
- Spring Boot Actuator Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-actuator)
- Spring Boot Json Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-json)
- Spring Boot Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter)
- Spring Boot Tomcat Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-tomcat)
- Spring Boot Web Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-web)
- Spring Boot Validation Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-validation)
- Spring Boot Web Starter (from http://projects.spring.io/spring-boot/)
- Spring Commons Logging Bridge (from https://github.com/spring-projects/spring-framework)
- Spring Context (from https://github.com/spring-projects/spring-framework)
- Spring Core (from https://github.com/spring-projects/spring-framework)
- Spring Data Core (from https://repo1.maven.org/maven2/org/springframework/data/spring-data-commons)
- Spring Expression Language (SpEL) (from https://github.com/spring-projects/spring-framework)
- Spring TestContext Framework (from https://github.com/spring-projects/spring-framework)
- Spring Transaction (from https://github.com/spring-projects/spring-framework)
- Spring beans (from https://repo1.maven.org/maven2/org/springframework/spring-beans)
- Spring context (from https://repo1.maven.org/maven2/org/springframework/spring-context)
- Spring core (from https://repo1.maven.org/maven2/org/springframework/spring-core)
- Spring web (from https://repo1.maven.org/maven2/org/springframework/spring-web)
- Spring web MVC (from https://repo1.maven.org/maven2/org/springframework/spring-webmvc)
- Spring Web (from https://github.com/spring-projects/spring-framework)
- Spring Web MVC (from https://github.com/spring-projects/spring-framework)
- T-Digest (from https://github.com/tdunning/t-digest)
- Vavr (from http://vavr.io)
- Vavr Match (from http://vavr.io)
- Woodstox (from https://github.com/FasterXML/woodstox)
- Zipkin Core Library (from https://repo1.maven.org/maven2/io/zipkin/zipkin2/zipkin)
- Zipkin Reporter Brave (from https://repo1.maven.org/maven2/io/zipkin/reporter2/zipkin-reporter-brave)
......@@ -162,25 +173,26 @@ The following software have components provided under the terms of this license:
- micrometer-core (from https://github.com/micrometer-metrics/micrometer)
- micrometer-registry-azure-monitor (from https://github.com/micrometer-metrics/micrometer)
- mockito-core (from https://github.com/mockito/mockito)
- okhttp (from https://square.github.io/okhttp/)
- okhttp-logging-interceptor (from https://square.github.io/okhttp/)
- okhttp-urlconnection (from https://github.com/square/okhttp)
- org.apiguardian:apiguardian-api (from https://github.com/apiguardian-team/apiguardian)
- org.opentest4j:opentest4j (from https://github.com/ota4j-team/opentest4j)
- parent-join (from https://github.com/elastic/elasticsearch)
- rank-eval (from https://github.com/elastic/elasticsearch)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- resilience4j (from https://resilience4j.readme.io)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- rest (from https://github.com/elastic/elasticsearch)
- rest-high-level (from https://github.com/elastic/elasticsearch)
- rxjava (from https://github.com/ReactiveX/RxJava)
- server (from https://github.com/elastic/elasticsearch)
- spring-boot (from https://spring.io/projects/spring-boot)
- spring-boot-actuator (from https://spring.io/projects/spring-boot)
- spring-boot-actuator-autoconfigure (from https://spring.io/projects/spring-boot)
- spring-boot-autoconfigure (from https://spring.io/projects/spring-boot)
- spring-boot-starter (from https://spring.io/projects/spring-boot)
- spring-boot-starter-actuator (from https://spring.io/projects/spring-boot)
- spring-boot-starter-log4j2 (from https://spring.io/projects/spring-boot)
- spring-boot-starter-validation (from https://spring.io/projects/spring-boot)
- swagger-annotations (from https://repo1.maven.org/maven2/io/swagger/swagger-annotations)
- swagger-jaxrs (from )
- tomcat-embed-core (from http://tomcat.apache.org/)
......@@ -214,7 +226,7 @@ The following software have components provided under the terms of this license:
- Netty/Codec/HTTP (from https://repo1.maven.org/maven2/io/netty/netty-codec-http)
- Reflections (from http://github.com/ronmamo/reflections)
- SnakeYAML (from http://code.google.com/p/snakeyaml/)
- Spring core (from https://repo1.maven.org/maven2/org/springframework/spring-core)
- Spring Core (from https://github.com/spring-projects/spring-framework)
- jakarta.xml.bind-api (from )
========================================================================
......@@ -263,6 +275,7 @@ EPL-1.0
========================================================================
The following software have components provided under the terms of this license:
- AspectJ weaver (from http://www.aspectj.org)
- Expression Language 3.0 (from https://projects.eclipse.org/projects/ee4j.el)
- JUnit Jupiter (Aggregator) (from https://junit.org/junit5/)
- JUnit Jupiter API (from https://junit.org/junit5/)
......@@ -412,7 +425,7 @@ The following software have components provided under the terms of this license:
- adal4j (from https://github.com/AzureAD/azure-activedirectory-library-for-java)
- azure-documentdb (from https://azure.microsoft.com/en-us/services/cosmos-db/)
- documentdb-bulkexecutor (from http://azure.microsoft.com/en-us/services/documentdb/)
- java jwt (from http://www.jwt.io)
- java jwt (from https://github.com/auth0/java-jwt)
- micrometer-core (from https://github.com/micrometer-metrics/micrometer)
- mockito-core (from https://github.com/mockito/mockito)
- mockito-junit-jupiter (from https://github.com/mockito/mockito)
......@@ -432,7 +445,7 @@ MPL-2.0
The following software have components provided under the terms of this license:
- Javassist (from http://www.javassist.org/)
- okhttp (from https://square.github.io/okhttp/)
- OkHttp (from https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp)
========================================================================
PHP-3.01
......@@ -492,7 +505,7 @@ The following software have components provided under the terms of this license:
- Microsoft Azure SDK for SQL API of Azure Cosmos DB Service (from https://github.com/Azure/azure-sdk-for-java)
- Microsoft Azure client library for Blob Storage (from https://github.com/Azure/azure-sdk-for-java)
- Project Lombok (from https://projectlombok.org)
- Spring web (from https://repo1.maven.org/maven2/org/springframework/spring-web)
- Spring Web (from https://github.com/spring-projects/spring-framework)
- azure-documentdb (from https://azure.microsoft.com/en-us/services/cosmos-db/)
- msal4j (from https://github.com/AzureAD/microsoft-authentication-library-for-java)
- reactive-streams (from http://www.reactive-streams.org/)
......
......@@ -46,6 +46,7 @@
<azure.servicebus.version>3.6.3</azure.servicebus.version>
<io.micrometer.version>1.6.6</io.micrometer.version>
<azure-spring-data-cosmos.version>3.7.0</azure-spring-data-cosmos.version>
<resilience4jVersion>1.7.0</resilience4jVersion>
</properties>
......@@ -253,6 +254,22 @@
</exclusion>
</exclusions>
</dependency>
<!-- dependencies for resilience4j -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-all</artifactId>
<version>${resilience4jVersion}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
......
......@@ -7,6 +7,8 @@ import org.springframework.stereotype.Component;
import java.util.Map;
import static org.opengroup.osdu.core.common.cache.enums.CachingStrategy.EXPIRE_AFTER_WRITE;
/**
* Implementation of ICache for PartitionServiceEventGridCache.
*/
......@@ -18,7 +20,7 @@ public class PartitionServiceEventGridCache extends VmCache<String, Map<String,
* Default cache constructor.
*/
public PartitionServiceEventGridCache() {
super(60 * 60, 1000);
super(60 * 60, 1000, EXPIRE_AFTER_WRITE);
}
/**
......
......@@ -14,8 +14,6 @@
package org.opengroup.osdu.azure.dependencies;
import com.azure.core.http.policy.ExponentialBackoff;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.identity.DefaultAzureCredential;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.security.keyvault.secrets.SecretClient;
......@@ -29,7 +27,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import javax.inject.Named;
import java.time.Duration;
/**
* Bootstraps Azure dependencies for OSDU.
......@@ -78,7 +75,6 @@ public class AzureOSDUConfig {
return new SecretClientBuilder()
.credential(credential)
.vaultUrl(keyVaultURL)
.retryPolicy(new RetryPolicy(new ExponentialBackoff(5, Duration.ofSeconds(1L), Duration.ofSeconds(16L))))
.buildClient();
}
......
......@@ -14,7 +14,12 @@
package org.opengroup.osdu.azure.httpconfig;
import io.github.resilience4j.circuitbreaker.CallNotPermittedException;
import io.github.resilience4j.circuitbreaker.CircuitBreaker;
import io.github.resilience4j.decorators.Decorators;
import org.apache.http.HttpStatus;
import org.opengroup.osdu.azure.logging.CoreLoggerFactory;
import org.opengroup.osdu.azure.resiliency.AzureCircuitBreakerConfiguration;
import org.opengroup.osdu.core.common.http.FetchServiceHttpRequest;
import org.opengroup.osdu.core.common.http.HttpRequest;
import org.opengroup.osdu.core.common.http.IHttpClient;
......@@ -25,7 +30,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.function.Supplier;
import static java.util.Arrays.asList;
/**
* Extends URlFetchService and implements IHttpClient to send requests.
......@@ -33,17 +42,20 @@ import java.net.URISyntaxException;
@Primary
@Component
public class HttpClientAzure implements IHttpClient {
private static final String LOGGER_NAME = HttpClientAzure.class.getName();
@Autowired
private AzureCircuitBreakerConfiguration azureCircuitBreakerConfiguration;
@Autowired
private UrlFetchServiceImpl urlFetchService;
/**
* calls urlfetchservice's send request.
* Decorated method to send request with circuitbreaker.
*
* @param httpRequest made by user class
* @return HttpResponse
*/
@Override
public HttpResponse send(final HttpRequest httpRequest) {
public HttpResponse decoratedSend(final HttpRequest httpRequest) {
org.opengroup.osdu.core.common.model.http.HttpResponse response = null;
try {
response = this.urlFetchService.sendRequest(FetchServiceHttpRequest.builder()
......@@ -63,4 +75,56 @@ public class HttpClientAzure implements IHttpClient {
httpResponse.setRequest(httpRequest);
return httpResponse;
}
/**
* calls urlfetchservice's send request after applying a circuitbreaker.
*
* @param httpRequest made by user class
* @return HttpResponse
*/
@Override
public HttpResponse send(final HttpRequest httpRequest) {
if (!azureCircuitBreakerConfiguration.isEnable()) {
// Call method without CircuitBreaker
return this.decoratedSend(httpRequest);
}
String circuitBreakerName = getHostName(httpRequest.getUrl());
if (circuitBreakerName == null) {
// Call method without CircuitBreaker
return this.decoratedSend(httpRequest);
}
CircuitBreaker circuitBreaker = azureCircuitBreakerConfiguration.getCircuitBreakerRegistry().circuitBreaker(circuitBreakerName);
circuitBreaker.getEventPublisher()
.onStateTransition(event -> CoreLoggerFactory.getInstance().getLogger(LOGGER_NAME).info("CircuitBreakerEvent : {}", event));
Supplier<HttpResponse> httpResponseSupplier = CircuitBreaker.decorateSupplier(circuitBreaker, () -> this.decoratedSend(httpRequest));
// Ensuring CallNotPermittedException that is being thrown by CircuitBreaker is caught and Error Code 503 is thrown.
// We are throwing Error 503 based on information from https://docs.microsoft.com/en-us/azure/architecture/patterns/circuit-breaker
return Decorators.ofSupplier(httpResponseSupplier).withFallback(asList(CallNotPermittedException.class), throwable -> {
CoreLoggerFactory.getInstance().getLogger(LOGGER_NAME).info(throwable.getMessage());
throw new AppException(HttpStatus.SC_SERVICE_UNAVAILABLE, "Service Unavailable", "Service Unavailable");
}).get();
}
/**
* Fetches hostname from URL.
* http://entitlements/api/entitlements/v2 --> entitlements
* @param url eg : http://entitlements/api/entitlements/v2
* @return will return "entitlements" or null if there's an error with URL
*/
public String getHostName(final String url) {
URI uri = null;
try {
uri = new URI(url);
} catch (URISyntaxException e) {
e.printStackTrace();
return null;
}
String hostname = uri.getHost();
// to provide faultproof result, check if not null then return only hostname, without www.
if (hostname != null) {
return hostname.startsWith("www.") ? hostname.substring(4) : hostname;
}
return null;
}
}
/** Copyright © Microsoft Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License
**/
package org.opengroup.osdu.azure.resiliency;
import io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* Configuration for CircuitBreaker.
*/
@Configuration
@ConfigurationProperties("azure.circuitbreaker")
@Getter
@Setter
public class AzureCircuitBreakerConfiguration {
/**
* Constructor which initializes CircuitBreakerRegistry.
*/
public AzureCircuitBreakerConfiguration() {
this.setCBR();
}
private boolean enable = false;
@Getter
private CircuitBreakerRegistry circuitBreakerRegistry;
/**
* Create CircuitBreakerRegistry.
*/
private void setCBR() {
// Create a CircuitBreakerRegistry with a custom global configuration
this.circuitBreakerRegistry = CircuitBreakerRegistry.ofDefaults();
}
}
/** Copyright © Microsoft Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License
**/
package org.opengroup.osdu.azure.httpconfig;
import io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.*;
import org.mockito.junit.jupiter.MockitoExtension;
import org.opengroup.osdu.azure.resiliency.AzureCircuitBreakerConfiguration;
import org.opengroup.osdu.core.common.http.FetchServiceHttpRequest;
import org.opengroup.osdu.core.common.http.HttpRequest;
import org.opengroup.osdu.core.common.http.UrlFetchServiceImpl;
import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.net.URISyntaxException;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;
@ExtendWith(MockitoExtension.class)
public class HttpClientAzureTest {
@InjectMocks
HttpClientAzure sut;
@Mock
UrlFetchServiceImpl urlFetchService;
@Spy
AzureCircuitBreakerConfiguration azureCircuitBreakerConfiguration;
@Test
public void when_circuitbreaker_name_is_localhost() throws URISyntaxException {
azureCircuitBreakerConfiguration.setEnable(true);
azureCircuitBreakerConfiguration.setCircuitBreakerRegistry(CircuitBreakerRegistry.ofDefaults());
when(azureCircuitBreakerConfiguration.isEnable()).thenReturn(true);
org.opengroup.osdu.core.common.model.http.HttpResponse httpResponse = new org.opengroup.osdu.core.common.model.http.HttpResponse();
httpResponse.setBody("rr");
when(urlFetchService.sendRequest(any(FetchServiceHttpRequest.class))).thenReturn(httpResponse);
sut.send(HttpRequest.builder().url("http://localhost/").build());
assertEquals(azureCircuitBreakerConfiguration.getCircuitBreakerRegistry().getAllCircuitBreakers().get(0).getName(),"localhost");
}
@Test
public void when_circuitbreaker_name_is_localhost_with_www() throws URISyntaxException {
azureCircuitBreakerConfiguration.setEnable(true);
azureCircuitBreakerConfiguration.setCircuitBreakerRegistry(CircuitBreakerRegistry.ofDefaults());
when(azureCircuitBreakerConfiguration.isEnable()).thenReturn(true);
org.opengroup.osdu.core.common.model.http.HttpResponse httpResponse = new org.opengroup.osdu.core.common.model.http.HttpResponse();
httpResponse.setBody("rr");
when(urlFetchService.sendRequest(any(FetchServiceHttpRequest.class))).thenReturn(httpResponse);
sut.send(HttpRequest.builder().url("http://www.localhost/").build());
assertEquals(azureCircuitBreakerConfiguration.getCircuitBreakerRegistry().getAllCircuitBreakers().get(0).getName(),"localhost");
}
@Test
public void when_circuitbreaker_name_is_entitlements() throws URISyntaxException {
azureCircuitBreakerConfiguration.setEnable(true);
azureCircuitBreakerConfiguration.setCircuitBreakerRegistry(CircuitBreakerRegistry.ofDefaults());
when(azureCircuitBreakerConfiguration.isEnable()).thenReturn(true);
org.opengroup.osdu.core.common.model.http.HttpResponse httpResponse = new org.opengroup.osdu.core.common.model.http.HttpResponse();
httpResponse.setBody("rr");
when(urlFetchService.sendRequest(any(FetchServiceHttpRequest.class))).thenReturn(httpResponse);
sut.send(HttpRequest.builder().url("http://entitlements/api/v2").build());
assertEquals(azureCircuitBreakerConfiguration.getCircuitBreakerRegistry().getAllCircuitBreakers().get(0).getName(),"entitlements");
}
}
/** Copyright © Microsoft Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License
**/
package org.opengroup.osdu.azure.resiliency;
import io.jsonwebtoken.lang.Assert;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.beans.factory.annotation.Autowired;
@ExtendWith(MockitoExtension.class)
public class AzureCircuitBreakerConfigurationTest {
AzureCircuitBreakerConfiguration circuitBreakerConfiguration = new AzureCircuitBreakerConfiguration();
@Test
public void should_create_CircuitBreakerRegistry() {
Assert.isTrue(circuitBreakerConfiguration.getCircuitBreakerRegistry()!=null);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment