Skip to content
Snippets Groups Projects
Commit fd5adc6c authored by Nikhil Singh[MicroSoft]'s avatar Nikhil Singh[MicroSoft] Committed by Komal Makkar
Browse files

Management client usage

parent 1e969a84
No related branches found
No related tags found
1 merge request!104Management client usage
Showing with 111 additions and 324 deletions
......@@ -84,28 +84,26 @@ The following software have components provided under the terms of this license:
- Byte Buddy agent (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent)
- ClassMate (from http://github.com/cowtowncoder/java-classmate)
- ClassMate (from http://github.com/cowtowncoder/java-classmate)
- Cloud Storage JSON API v1-rev20210127-1.32.1 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage)
- Cloud Storage JSON API v1-rev20200927-1.30.10 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage)
- Collections (from https://repo1.maven.org/maven2/commons-collections/commons-collections)
- Converter: Jackson (from https://repo1.maven.org/maven2/com/squareup/retrofit2/converter-jackson)
- Core functionality for the Reactor Netty library (from https://github.com/reactor/reactor-netty)
- Elastic JNA Distribution (from https://github.com/java-native-access/jna)
- Elastic JNA Distribution (from https://github.com/java-native-access/jna)
- Elasticsearch: Core (from https://repo1.maven.org/maven2/org/elasticsearch/elasticsearch)
- Elasticsearch: Core (from https://repo1.maven.org/maven2/org/elasticsearch/elasticsearch)
- Expression Language 3.0 (from https://projects.eclipse.org/projects/ee4j.el)
- Expression Language 3.0 API (from http://uel.java.net)
- FindBugs-jsr305 (from http://findbugs.sourceforge.net/)
- GSON extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-gson)
- Google APIs Client Library for Java (from https://repo1.maven.org/maven2/com/google/api-client/google-api-client)
- Google App Engine extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-appengine)
- Google Cloud Core (from https://github.com/googleapis/java-core)
- Google Cloud Core HTTP (from https://github.com/googleapis/java-core)
- Google Cloud Core (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core)
- Google Cloud Core HTTP (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core-http)
- Google Cloud Core gRPC (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core-grpc)
- Google Cloud Datastore (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-datastore)
- Google Cloud Datastore (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-datastore)
- Google Cloud Key Management Service (KMS) API v1-rev9-1.22.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms)
- Google Cloud Logging (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-logging)
- Google Cloud Pub/Sub (from https://github.com/googleapis/java-pubsub)
- Google Cloud Storage (from https://github.com/googleapis/java-storage)
- Google Cloud Logging (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-logging)
- Google Cloud Pub/Sub (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-pubsub)
- Google Cloud Storage (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-storage)
- Google HTTP Client Library for Java (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client)
- Google OAuth Client Library for Java (from https://repo1.maven.org/maven2/com/google/oauth-client/google-oauth-client)
- Gson (from http://code.google.com/p/google-gson/)
......@@ -115,9 +113,9 @@ The following software have components provided under the terms of this license:
- HPPC Collections (from https://repo1.maven.org/maven2/com/carrotsearch/hppc)
- HPPC Collections (from https://repo1.maven.org/maven2/com/carrotsearch/hppc)
- HTTP functionality for the Reactor Netty library (from https://github.com/reactor/reactor-netty)
- Hibernate Validator Engine (from https://repo1.maven.org/maven2/org/hibernate/validator/hibernate-validator)
- Hibernate Validator Engine (from https://repo1.maven.org/maven2/org/hibernate/hibernate-validator)
- Hibernate Validator Engine (from https://repo1.maven.org/maven2/org/hibernate/validator/hibernate-validator)
- Hibernate Validator Engine (from https://repo1.maven.org/maven2/org/hibernate/validator/hibernate-validator)
- HttpCore (NIO extensions module) (from http://hc.apache.org/httpcomponents-core/)
- HttpCore (NIO extensions module) (from http://hc.apache.org/httpcomponents-core/)
- HttpCore (base module) (from http://hc.apache.org/httpcomponents-core/)
......@@ -138,30 +136,31 @@ The following software have components provided under the terms of this license:
- JSON Web Token support for the JVM (from https://github.com/jwtk/jjwt)
- JSON library from Android SDK (from http://developer.android.com/sdk)
- JSONassert (from https://github.com/skyscreamer/JSONassert)
- JSR107 API and SPI (from https://github.com/jsr107/jsr107spec)
- Jackson (from http://jackson.codehaus.org)
- Jackson 2 extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-jackson2)
- Jackson dataformat: CBOR (from http://github.com/FasterXML/jackson-dataformats-binary)
- Jackson dataformat: CBOR (from http://github.com/FasterXML/jackson-dataformats-binary)
- Jackson dataformat: Smile (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)
- Jackson datatype: JSR310 (from https://repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310)
- Jackson datatype: jdk8 (from https://repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jdk8)
- Jackson datatype: jdk8 (from https://repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jdk8)
- Jackson extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-jackson)
- Jackson module: JAXB Annotations (from https://github.com/FasterXML/jackson-modules-base)
- Jackson module: JAXB Annotations (from https://github.com/FasterXML/jackson-modules-base)
- Jackson-annotations (from http://github.com/FasterXML/jackson)
- Jackson-annotations (from http://github.com/FasterXML/jackson)
- Jackson-core (from http://wiki.fasterxml.com/JacksonHome)
- Jackson-core (from http://wiki.fasterxml.com/JacksonHome)
- Jackson-dataformat-Smile (from http://github.com/FasterXML/jackson-dataformat-smile)
- Jackson-dataformat-Smile (from http://github.com/FasterXML/jackson-dataformat-smile)
- Jackson-dataformat-XML (from http://wiki.fasterxml.com/JacksonExtensionXmlDataBinding)
- Jackson-dataformat-YAML (from https://github.com/FasterXML/jackson)
- Jackson-dataformat-YAML (from https://github.com/FasterXML/jackson)
- Jackson-dataformat-YAML (from https://github.com/FasterXML/jackson-dataformats-text)
- Jackson-dataformat-YAML (from https://github.com/FasterXML/jackson-dataformats-text)
- Jackson-datatype-Joda (from http://wiki.fasterxml.com/JacksonModuleJoda)
- Jackson-datatype-Joda (from http://wiki.fasterxml.com/JacksonModuleJoda)
- Jackson-datatype-Joda (from http://wiki.fasterxml.com/JacksonModuleJoda)
- Jackson-module-Afterburner (from http://wiki.fasterxml.com/JacksonHome)
- Jackson-module-JAXB-annotations (from http://wiki.fasterxml.com/JacksonJAXBAnnotations)
- Jackson-module-JAXB-annotations (from http://wiki.fasterxml.com/JacksonJAXBAnnotations)
- Jackson-module-parameter-names (from https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-parameter-names)
- Jackson-module-parameter-names (from https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-parameter-names)
- Java Native Access (from https://github.com/java-native-access/jna)
......@@ -177,8 +176,8 @@ The following software have components provided under the terms of this license:
- KeePassJava2 :: KDB (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-kdb)
- KeePassJava2 :: KDBX (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-kdbx)
- KeePassJava2 :: Simple (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-simple)
- Logback Contrib :: JSON :: Classic (from )
- Logback Contrib :: JSON :: Core (from )
- Logback Contrib :: JSON :: Classic (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-classic)
- Logback Contrib :: JSON :: Core (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-core)
- Logback Contrib :: Jackson (from )
- Lucene Common Analyzers (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common)
- Lucene Common Analyzers (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common)
......@@ -191,8 +190,8 @@ The following software have components provided under the terms of this license:
- Lucene Join (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-join)
- 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-memory)
- 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 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 Miscellaneous (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-misc)
......@@ -293,8 +292,6 @@ The following software have components provided under the terms of this license:
- Spring Boot Actuator Starter (from http://projects.spring.io/spring-boot/)
- Spring Boot AutoConfigure (from http://projects.spring.io/spring-boot/)
- Spring Boot AutoConfigure (from http://projects.spring.io/spring-boot/)
- Spring Boot Json Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-json)
- Spring Boot Json Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-json)
- Spring Boot Logging Starter (from http://projects.spring.io/spring-boot/)
- Spring Boot Reactor Netty Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-reactor-netty)
- Spring Boot Security Starter (from http://projects.spring.io/spring-boot/)
......@@ -307,12 +304,8 @@ The following software have components provided under the terms of this license:
- Spring Boot Test Auto-Configure (from http://projects.spring.io/spring-boot/)
- Spring Boot Test Starter (from http://projects.spring.io/spring-boot/)
- Spring Boot Test Starter (from http://projects.spring.io/spring-boot/)
- Spring Boot Tomcat Starter (from http://projects.spring.io/spring-boot/)
- Spring Boot Tomcat Starter (from http://projects.spring.io/spring-boot/)
- Spring Boot Validation Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-validation)
- 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 Boot Web Starter (from http://projects.spring.io/spring-boot/)
- Spring Boot WebFlux Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-webflux)
- Spring Commons Logging Bridge (from https://github.com/spring-projects/spring-framework)
- Spring Commons Logging Bridge (from https://github.com/spring-projects/spring-framework)
......@@ -333,10 +326,12 @@ The following software have components provided under the terms of this license:
- Spring Transaction (from https://github.com/spring-projects/spring-framework)
- Spring Web (from https://github.com/spring-projects/spring-framework)
- Spring Web (from https://github.com/spring-projects/spring-framework)
- Spring Web MVC (from https://github.com/SpringSource/spring-framework)
- Spring Web MVC (from https://github.com/SpringSource/spring-framework)
- Spring Web MVC (from https://github.com/spring-projects/spring-framework)
- Spring Web MVC (from https://github.com/spring-projects/spring-framework)
- Spring WebFlux (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)
......@@ -345,18 +340,23 @@ The following software have components provided under the terms of this license:
- aggs-matrix-stats (from https://github.com/elastic/elasticsearch)
- aggs-matrix-stats (from https://github.com/elastic/elasticsearch)
- aws-ssm-java-caching-client (from https://github.com/awslabs/aws-ssm-java-caching-client)
- cli (from https://github.com/elastic/elasticsearch)
- cli (from https://github.com/elastic/elasticsearch)
- com.google.api.grpc:grpc-google-cloud-pubsub-v1 (from https://github.com/googleapis/googleapis)
- com.google.api.grpc:proto-google-cloud-logging-v2 (from https://github.com/googleapis/googleapis)
- com.google.api.grpc:proto-google-cloud-datastore-v1 (from https://github.com/googleapis/googleapis)
- com.google.api.grpc:proto-google-common-protos (from https://github.com/googleapis/googleapis)
- compiler (from http://github.com/spullara/mustache.java)
- compiler (from http://github.com/spullara/mustache.java)
- datastore-v1-proto-client (from )
- datastore-v1-proto-client (from https://repo1.maven.org/maven2/com/google/cloud/datastore/datastore-v1-proto-client)
- elasticsearch-cli (from https://github.com/elastic/elasticsearch)
- elasticsearch-cli (from https://github.com/elastic/elasticsearch)
- elasticsearch-core (from https://github.com/elastic/elasticsearch)
- elasticsearch-core (from https://github.com/elastic/elasticsearch)
- elasticsearch-geo (from https://github.com/elastic/elasticsearch)
- elasticsearch-secure-sm (from https://github.com/elastic/elasticsearch)
- elasticsearch-secure-sm (from https://github.com/elastic/elasticsearch)
- elasticsearch-x-content (from https://github.com/elastic/elasticsearch)
- elasticsearch-x-content (from https://github.com/elastic/elasticsearch)
- error-prone annotations (from https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations)
- error-prone annotations (from https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations)
- grpc-google-cloud-pubsub-v1 (from https://repo1.maven.org/maven2/com/google/api/grpc/grpc-google-cloud-pubsub-v1)
- io.grpc:grpc-alts (from https://github.com/grpc/grpc-java)
- io.grpc:grpc-api (from https://github.com/grpc/grpc-java)
- io.grpc:grpc-auth (from https://github.com/grpc/grpc-java)
......@@ -377,8 +377,8 @@ The following software have components provided under the terms of this license:
- java-cloudant (from https://cloudant.com)
- javaparser-core (from https://repo1.maven.org/maven2/com/github/javaparser/javaparser-core)
- javatuples (from http://www.javatuples.org)
- javax.inject (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/javax.inject)
- javax.inject (from http://code.google.com/p/atinject/)
- javax.inject (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/javax.inject)
- javax.ws.rs-api (from https://github.com/eclipse-ee4j/jaxrs-api)
- javax.ws.rs-api (from http://jax-rs-spec.java.net)
- jersey-container-servlet (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet)
......@@ -420,30 +420,44 @@ The following software have components provided under the terms of this license:
- 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)
- org.xmlunit:xmlunit-core (from http://www.xmlunit.org/)
- org.xmlunit:xmlunit-core (from http://www.xmlunit.org/)
- org.xmlunit:xmlunit-core (from https://www.xmlunit.org/)
- org.xmlunit:xmlunit-core (from https://www.xmlunit.org/)
- parent-join (from https://github.com/elastic/elasticsearch)
- parent-join (from https://github.com/elastic/elasticsearch)
- powermock-api-mockito (from https://repo1.maven.org/maven2/org/powermock/powermock-api-mockito)
- powermock-module-junit4-common (from https://repo1.maven.org/maven2/org/powermock/powermock-module-junit4-common)
- powermock-module-junit4-common (from https://repo1.maven.org/maven2/org/powermock/powermock-module-junit4-common)
- proto-google-cloud-datastore-v1 (from https://github.com/googleapis/api-client-staging)
- proto-google-cloud-pubsub-v1 (from https://github.com/googleapis/java-pubsub/proto-google-cloud-pubsub-v1)
- proto-google-common-protos (from https://github.com/googleapis/java-iam/proto-google-common-protos)
- proto-google-cloud-logging-v2 (from https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-cloud-logging-v2)
- proto-google-cloud-pubsub-v1 (from https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-cloud-pubsub-v1)
- proto-google-iam-v1 (from https://github.com/googleapis/java-iam/proto-google-iam-v1)
- rank-eval (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://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)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- rest (from https://github.com/elastic/elasticsearch)
- rest (from https://github.com/elastic/elasticsearch)
- rest-high-level (from https://github.com/elastic/elasticsearch)
- rest-high-level (from https://github.com/elastic/elasticsearch)
- rxjava (from https://github.com/ReactiveX/RxJava)
- secure-sm (from https://github.com/elastic/elasticsearch)
- secure-sm (from https://github.com/elastic/elasticsearch)
- server (from https://github.com/elastic/elasticsearch)
- server (from https://github.com/elastic/elasticsearch)
- spring-boot-dependencies (from https://spring.io/projects/spring-boot)
- spring-boot-starter-aop (from https://spring.io/projects/spring-boot)
- spring-boot-starter-jersey (from https://spring.io/projects/spring-boot)
- spring-boot-starter-jersey (from https://spring.io/projects/spring-boot)
- spring-boot-starter-json (from https://spring.io/projects/spring-boot)
- spring-boot-starter-json (from https://spring.io/projects/spring-boot)
- spring-boot-starter-log4j2 (from https://spring.io/projects/spring-boot)
- spring-boot-starter-tomcat (from https://spring.io/projects/spring-boot)
- spring-boot-starter-tomcat (from https://spring.io/projects/spring-boot)
- spring-boot-starter-web (from https://spring.io/projects/spring-boot)
- spring-boot-starter-web (from https://spring.io/projects/spring-boot)
- spring-security-config (from http://spring.io/spring-security)
- spring-security-config (from http://spring.io/spring-security)
- spring-security-core (from http://spring.io/spring-security)
......@@ -472,24 +486,22 @@ The following software have components provided under the terms of this license:
- tomcat-embed-core (from http://tomcat.apache.org/)
- tomcat-embed-core (from http://tomcat.apache.org/)
- tomcat-embed-core (from http://tomcat.apache.org/)
- tomcat-embed-el (from http://tomcat.apache.org/)
- tomcat-embed-websocket (from http://tomcat.apache.org/)
- tomcat-embed-websocket (from http://tomcat.apache.org/)
- x-content (from https://github.com/elastic/elasticsearch)
- x-content (from https://github.com/elastic/elasticsearch)
- tomcat-embed-el (from https://tomcat.apache.org/)
- tomcat-embed-websocket (from https://tomcat.apache.org/)
- tomcat-embed-websocket (from https://tomcat.apache.org/)
========================================================================
BSD-2-Clause
========================================================================
The following software have components provided under the terms of this license:
- API Common (from https://github.com/googleapis/api-common-java)
- API Common (from https://github.com/googleapis)
- ASM Analysis (from )
- ASM Commons (from https://repo1.maven.org/maven2/org/ow2/asm/asm-commons)
- ASM Tree (from )
- ASM Util (from )
- GAX (Google Api eXtensions) for Java (from https://github.com/googleapis/gax-java)
- GAX (Google Api eXtensions) for Java (from https://github.com/googleapis/gax-java)
- GAX (Google Api eXtensions) (from https://github.com/googleapis)
- GAX (Google Api eXtensions) (from https://github.com/googleapis)
- GAX (Google Api eXtensions) for Java (from https://github.com/googleapis/gax-java)
- Hamcrest (from http://hamcrest.org/JavaHamcrest/)
- Lucene Common Analyzers (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common)
......@@ -516,7 +528,7 @@ BSD-3-Clause
========================================================================
The following software have components provided under the terms of this license:
- API Common (from https://github.com/googleapis/api-common-java)
- API Common (from https://github.com/googleapis)
- ASM Analysis (from )
- ASM Commons (from https://repo1.maven.org/maven2/org/ow2/asm/asm-commons)
- ASM Core (from https://repo1.maven.org/maven2/org/ow2/asm/asm)
......@@ -524,8 +536,8 @@ The following software have components provided under the terms of this license:
- ASM Util (from )
- Apache Commons Codec (from https://commons.apache.org/proper/commons-codec/)
- Apache Commons Codec (from https://commons.apache.org/proper/commons-codec/)
- GAX (Google Api eXtensions) for Java (from https://github.com/googleapis/gax-java)
- GAX (Google Api eXtensions) for Java (from https://github.com/googleapis/gax-java)
- GAX (Google Api eXtensions) (from https://github.com/googleapis)
- GAX (Google Api eXtensions) (from https://github.com/googleapis)
- GAX (Google Api eXtensions) for Java (from https://github.com/googleapis/gax-java)
- Google APIs Client Library for Java (from https://repo1.maven.org/maven2/com/google/api-client/google-api-client)
- Google Auth Library for Java - Credentials (from https://repo1.maven.org/maven2/com/google/auth/google-auth-library-credentials)
......@@ -658,6 +670,7 @@ EPL-1.0
========================================================================
The following software have components provided under the terms of this license:
- AspectJ Weaver (from https://www.eclipse.org/aspectj/)
- Class Model for Hk2 (from https://repo1.maven.org/maven2/org/glassfish/hk2/class-model)
- Eclipse Xbase Runtime Library (from )
- Eclipse Xtend Active Annotations Library (from https://www.eclipse.org/Xtext/)
......@@ -669,11 +682,11 @@ The following software have components provided under the terms of this license:
- HK2 module of HK2 itself (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2)
- JUnit Jupiter (Aggregator) (from https://junit.org/junit5/)
- JUnit Jupiter Params (from https://junit.org/junit5/)
- Logback Classic Module (from http://logback.qos.ch)
- Logback Contrib :: JSON :: Classic (from )
- Logback Contrib :: JSON :: Core (from )
- Logback Classic Module (from https://repo1.maven.org/maven2/ch/qos/logback/logback-classic)
- Logback Contrib :: JSON :: Classic (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-classic)
- Logback Contrib :: JSON :: Core (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-core)
- Logback Contrib :: Jackson (from )
- Logback Core Module (from http://logback.qos.ch)
- Logback Core Module (from https://repo1.maven.org/maven2/ch/qos/logback/logback-core)
- Microsoft Application Insights Java SDK Core (from https://github.com/Microsoft/ApplicationInsights-Java)
- Microsoft Application Insights Java SDK Spring Boot starter (from https://github.com/Microsoft/ApplicationInsights-Java)
- Microsoft Application Insights Java SDK Web Module (from https://github.com/Microsoft/ApplicationInsights-Java)
......@@ -892,11 +905,11 @@ The following software have components provided under the terms of this license:
- Java Native Access (from https://github.com/java-native-access/jna)
- Java Native Access Platform (from https://github.com/java-native-access/jna)
- Javassist (from http://www.javassist.org/)
- Logback Classic Module (from http://logback.qos.ch)
- Logback Contrib :: JSON :: Classic (from )
- Logback Contrib :: JSON :: Core (from )
- Logback Classic Module (from https://repo1.maven.org/maven2/ch/qos/logback/logback-classic)
- Logback Contrib :: JSON :: Classic (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-classic)
- Logback Contrib :: JSON :: Core (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-core)
- Logback Contrib :: Jackson (from )
- Logback Core Module (from http://logback.qos.ch)
- Logback Core Module (from https://repo1.maven.org/maven2/ch/qos/logback/logback-core)
- Microsoft Application Insights Java SDK Core (from https://github.com/Microsoft/ApplicationInsights-Java)
- Microsoft Application Insights Java SDK Spring Boot starter (from https://github.com/Microsoft/ApplicationInsights-Java)
- Microsoft Application Insights Java SDK Web Module (from https://github.com/Microsoft/ApplicationInsights-Java)
......
......@@ -29,7 +29,7 @@
<packaging>jar</packaging>
<version>0.11.0-SNAPSHOT</version>
<properties>
<osdu.corelibazure.version>0.10.1</osdu.corelibazure.version>
<osdu.corelibazure.version>0.11.0-rc3</osdu.corelibazure.version>
<junit-jupiter.version>5.6.0</junit-jupiter.version>
<mockito-junit-jupiter.version>2.23.0</mockito-junit-jupiter.version>
<oauth2-oidc-sdk.version>6.5</oauth2-oidc-sdk.version>
......
// 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.register.provider.azure.subscriber.messageBus;
import com.microsoft.azure.servicebus.management.ManagementClient;
public interface IManagementClientFactory {
ManagementClient getManager();
}
// 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.register.provider.azure.subscriber.messageBus;
import com.microsoft.azure.servicebus.management.ManagementClient;
import org.opengroup.osdu.core.common.cache.VmCache;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
@Lazy
@Component
public class ManagementClientCache extends VmCache<String, ManagementClient> {
public ManagementClientCache() {
super(3600, 1000);
}
public boolean containsKey(String key) {
return this.get(key) != null;
}
}
\ No newline at end of file
// 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.register.provider.azure.subscriber.messageBus;
import com.microsoft.azure.servicebus.management.ManagementClient;
import com.microsoft.azure.servicebus.primitives.ConnectionStringBuilder;
import org.opengroup.osdu.azure.partition.PartitionInfoAzure;
import org.opengroup.osdu.azure.partition.PartitionServiceClient;
import org.opengroup.osdu.common.Validators;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
@Component
@ConditionalOnProperty(
value = {"azure.serviceBus.enabled"},
havingValue = "true",
matchIfMissing = true
)
public class ManagementClientFactoryImpl implements IManagementClientFactory {
private static final String MANAGEMENT_CLIENT_ERROR_MESSAGE = "Unable to create management client";
@Autowired
private PartitionServiceClient partitionService;
@Autowired
private ManagementClientCache clientCache;
@Autowired
private DpsHeaders dpsHeaders;
@Autowired
private JaxRsDpsLog logger;
public ManagementClientFactoryImpl() {
}
public ManagementClient getManager() {
Validators.checkNotNullAndNotEmpty(dpsHeaders.getPartitionId(), "partitionId");
String cacheKey = dpsHeaders.getPartitionId() + "-managementClient";
if (this.clientCache.containsKey(cacheKey)) {
return (ManagementClient) this.clientCache.get(cacheKey);
} else {
try {
PartitionInfoAzure pi = this.partitionService.getPartition(dpsHeaders.getPartitionId());
String serviceBusConnectionString = pi.getSbConnection();
ConnectionStringBuilder connectionStringBuilder = new ConnectionStringBuilder(serviceBusConnectionString);
ManagementClient managementClient = new ManagementClient(connectionStringBuilder);
if (managementClient == null)
throw new NullPointerException();
logger.debug("Management client creation successful for partition Id : " + dpsHeaders.getPartitionId());
this.clientCache.put(cacheKey, managementClient);
return managementClient;
} catch (Exception e) {
if (e instanceof NullPointerException) {
logger.error("Management client can not be Null for partition Id : " + dpsHeaders.getPartitionId());
throw new AppException(500, "Null Pointer Exception", MANAGEMENT_CLIENT_ERROR_MESSAGE);
} else {
logger.error("Management client creation failed for partition Id : " + dpsHeaders.getPartitionId());
throw new AppException(500, "Server Error", MANAGEMENT_CLIENT_ERROR_MESSAGE + " : " + e.getMessage().toString());
}
}
}
}
}
......@@ -17,10 +17,10 @@ package org.opengroup.osdu.register.provider.azure.subscriber.pubsub;
import com.microsoft.azure.servicebus.management.ManagementClient;
import com.microsoft.azure.servicebus.primitives.MessagingEntityAlreadyExistsException;
import com.microsoft.azure.servicebus.primitives.MessagingEntityNotFoundException;
import org.opengroup.osdu.azure.serviceBusManager.IManagementClientFactory;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.register.provider.azure.subscriber.messageBus.IManagementClientFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
......@@ -37,7 +37,7 @@ public class PullSubscription implements IPubsubSubscription {
private JaxRsDpsLog logger;
public void createSubscription(String subscriptionId, String topicAliasName) {
ManagementClient managementClient = factory.getManager();
ManagementClient managementClient = factory.getManager(dpsHeaders.getPartitionId());
try {
managementClient.createSubscription(topicAliasName, subscriptionId);
logger.debug(String.format("Pull Subscription with id %s created successfully", subscriptionId));
......@@ -56,7 +56,7 @@ public class PullSubscription implements IPubsubSubscription {
}
public void deleteSubscription(String subscriptionId, String topicAliasName) {
ManagementClient managementClient = factory.getManager();
ManagementClient managementClient = factory.getManager(dpsHeaders.getPartitionId());
try {
managementClient.deleteSubscription(topicAliasName, subscriptionId);
logger.debug(String.format("Pull Subscription with id %s deleted successfully", subscriptionId));
......@@ -75,7 +75,7 @@ public class PullSubscription implements IPubsubSubscription {
}
public void checkIfSubscriptionExists(String subscriptionId, String topicAliasName) {
ManagementClient managementClient = factory.getManager();
ManagementClient managementClient = factory.getManager(dpsHeaders.getPartitionId());
try {
managementClient.getSubscription(topicAliasName, subscriptionId);
logger.debug(String.format("Pull Subscription with id %s fetched successfully", subscriptionId));
......
// 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.register.provider.azure.messageBus;
import com.microsoft.azure.servicebus.management.ManagementClient;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.opengroup.osdu.azure.partition.PartitionInfoAzure;
import org.opengroup.osdu.azure.partition.PartitionServiceClient;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.register.provider.azure.subscriber.messageBus.ManagementClientCache;
import org.opengroup.osdu.register.provider.azure.subscriber.messageBus.ManagementClientFactoryImpl;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;
@ExtendWith(MockitoExtension.class)
public class ManagementClientFactoryTest {
private static final String MANAGEMENT_CLIENT_ERROR_MESSAGE = "Unable to create management client";
private static final String dataPartitionId = "data-partition-id";
private static final String sbConnection = "Endpoint=sb://namespacename.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=abcdefghijkl=";
private static final String sbConnectionEmpty = "";
@Mock
private PartitionServiceClient partitionService;
@Mock
private ManagementClientCache clientCache;
@Mock
private DpsHeaders dpsHeaders;
@Mock
private PartitionInfoAzure partitionInfoAzure;
@Mock
private JaxRsDpsLog logger;
@Mock
private ManagementClient managementClient;
@InjectMocks
private ManagementClientFactoryImpl sut;
@BeforeEach
public void init() {
lenient().doReturn(dataPartitionId).when(dpsHeaders).getPartitionId();
lenient().doReturn(partitionInfoAzure).when(partitionService).getPartition(dataPartitionId);
lenient().doNothing().when(clientCache).put(any(), any());
}
@Test
public void shouldReturnManagementClient() {
lenient().doReturn(sbConnection).when(partitionInfoAzure).getSbConnection();
lenient().when(clientCache.containsKey(dpsHeaders.getPartitionId() + "-managementClient")).thenReturn(false);
ManagementClient client = sut.getManager();
verify(partitionService, times(1)).getPartition(dataPartitionId);
verify(partitionInfoAzure, times(1)).getSbConnection();
verify(clientCache, times(1)).put(dpsHeaders.getPartitionId() + "-managementClient", client);
verify(logger, times(1)).debug("Management client creation successful for partition Id : " + dpsHeaders.getPartitionId());
}
@Test
public void shouldReturnManagementClientIfPresentInCache() {
lenient().doReturn(sbConnection).when(partitionInfoAzure).getSbConnection();
lenient().when(clientCache.containsKey(dpsHeaders.getPartitionId() + "-managementClient")).thenReturn(true);
lenient().when(clientCache.get(dpsHeaders.getPartitionId() + "-managementClient")).thenReturn(managementClient);
ManagementClient client = sut.getManager();
assertEquals(managementClient, client);
verify(partitionService, times(0)).getPartition(dataPartitionId);
verify(partitionInfoAzure, times(0)).getSbConnection();
verify(clientCache, times(0)).put(dpsHeaders.getPartitionId() + "-managementClient", managementClient);
}
@Test
public void shouldThrowAppExceptionWhenNullManagementClient() {
lenient().doReturn(sbConnectionEmpty).when(partitionInfoAzure).getSbConnection();
lenient().when(clientCache.containsKey(dpsHeaders.getPartitionId() + "-managementClient")).thenReturn(false);
AppException exception = assertThrows(AppException.class, () -> {
sut.getManager();
});
assertNotNull(exception);
assertEquals(500, exception.getError().getCode());
verify(partitionService, times(1)).getPartition(dataPartitionId);
verify(partitionInfoAzure, times(1)).getSbConnection();
verify(clientCache, times(0)).put(dpsHeaders.getPartitionId() + "-managementClient", managementClient);
verify(logger, times(1)).error("Management client creation failed for partition Id : " + dpsHeaders.getPartitionId());
}
}
......@@ -18,14 +18,16 @@ import com.microsoft.azure.servicebus.management.ManagementClient;
import com.microsoft.azure.servicebus.management.SubscriptionDescription;
import com.microsoft.azure.servicebus.primitives.MessagingEntityNotFoundException;
import com.microsoft.azure.servicebus.primitives.ServiceBusException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.opengroup.osdu.azure.serviceBusManager.IManagementClientFactory;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.register.provider.azure.subscriber.messageBus.IManagementClientFactory;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.register.provider.azure.subscriber.pubsub.PullSubscription;
import static org.junit.jupiter.api.Assertions.assertEquals;
......@@ -38,7 +40,7 @@ import static org.mockito.Mockito.when;
@ExtendWith(MockitoExtension.class)
public class PullSubscriptionTest {
private static final String dataPartitionId = "data-partition-id";
private static final String subscriptionId = "subscription-id";
private static final String topicName = "topic-name";
private static final String errorMessage = "some error message";
......@@ -52,28 +54,36 @@ public class PullSubscriptionTest {
@Mock
private JaxRsDpsLog logger;
@Mock
private DpsHeaders dpsHeaders;
@Mock
private ManagementClient serviceBusManager;
@InjectMocks
private PullSubscription pullSubscription;
@BeforeEach
public void init() {
lenient().when(dpsHeaders.getPartitionId()).thenReturn(dataPartitionId);
}
@Test
public void shouldCreatePullSubscription() throws Exception {
lenient().when(factory.getManager()).thenReturn(serviceBusManager);
lenient().when(factory.getManager(dataPartitionId)).thenReturn(serviceBusManager);
SubscriptionDescription subscriptionDescription = new SubscriptionDescription(topicName, subscriptionId);
lenient().when(serviceBusManager.createSubscription(topicName, subscriptionId)).thenReturn(subscriptionDescription);
pullSubscription.createSubscription(subscriptionId, topicName);
verify(factory, times(1)).getManager();
verify(factory, times(1)).getManager(dataPartitionId);
verify(serviceBusManager, times(1)).createSubscription(topicName, subscriptionId);
verify(logger, times(1)).debug(String.format("Pull Subscription with id %s created successfully", subscriptionId));
}
@Test
public void shouldReturn500WhenPullSubscriptionCreationFailed() throws Exception {
lenient().when(factory.getManager()).thenReturn(serviceBusManager);
lenient().when(factory.getManager(dataPartitionId)).thenReturn(serviceBusManager);
when(serviceBusManager.createSubscription(topicName, subscriptionId)).thenThrow(new ServiceBusException(true, SERVICE_BUS_ERROR_MESSAGE));
AppException exception = assertThrows(AppException.class, () -> {
......@@ -82,13 +92,13 @@ public class PullSubscriptionTest {
assertNotNull(exception);
assertEquals(500, exception.getError().getCode());
verify(factory, times(1)).getManager();
verify(factory, times(1)).getManager(dataPartitionId);
verify(serviceBusManager, times(1)).createSubscription(topicName, subscriptionId);
}
@Test
public void shouldThrow409WhenConflictInPullSubscriptionCreation() throws Exception {
lenient().when(factory.getManager()).thenReturn(serviceBusManager);
lenient().when(factory.getManager(dataPartitionId)).thenReturn(serviceBusManager);
when(serviceBusManager.createSubscription(topicName, subscriptionId)).thenThrow(new ServiceBusException(true, RESOURCE_PROVISIONING_ERROR_MESSAGE));
AppException exception = assertThrows(AppException.class, () -> {
......@@ -98,14 +108,14 @@ public class PullSubscriptionTest {
assertNotNull(exception);
assertEquals(409, exception.getError().getCode());
assertEquals("Another request is trying to create the same Pull subscription", exception.getMessage());
verify(factory, times(1)).getManager();
verify(factory, times(1)).getManager(dataPartitionId);
verify(serviceBusManager, times(1)).createSubscription(topicName, subscriptionId);
verify(logger, times(1)).error("Another request is trying to create the same Pull subscription");
}
@Test
public void shouldThrow500NullPointerExceptionWhenPullSubscriptionCreationFailed() throws Exception {
lenient().when(factory.getManager()).thenThrow(new AppException(500, "Null Pointer Exception", MANAGEMENT_CLIENT_ERROR_MESSAGE));
lenient().when(factory.getManager(dataPartitionId)).thenThrow(new AppException(500, "Null Pointer Exception", MANAGEMENT_CLIENT_ERROR_MESSAGE));
AppException exception = assertThrows(AppException.class, () -> {
pullSubscription.createSubscription(subscriptionId, topicName);
......@@ -114,25 +124,25 @@ public class PullSubscriptionTest {
assertNotNull(exception);
assertEquals(500, exception.getError().getCode());
assertEquals(MANAGEMENT_CLIENT_ERROR_MESSAGE, exception.getMessage());
verify(factory, times(1)).getManager();
verify(factory, times(1)).getManager(dataPartitionId);
verify(serviceBusManager, times(0)).createSubscription(topicName, subscriptionId);
}
@Test
public void shouldDeletePullSubscription() throws Exception {
lenient().when(factory.getManager()).thenReturn(serviceBusManager);
lenient().when(factory.getManager(dataPartitionId)).thenReturn(serviceBusManager);
lenient().doNothing().when(serviceBusManager).deleteSubscription(topicName, subscriptionId);
pullSubscription.deleteSubscription(subscriptionId, topicName);
verify(factory, times(1)).getManager();
verify(factory, times(1)).getManager(dataPartitionId);
verify(serviceBusManager, times(1)).deleteSubscription(topicName, subscriptionId);
verify(logger, times(1)).debug(String.format("Pull Subscription with id %s deleted successfully", subscriptionId));
}
@Test
public void shouldThrowMessagingEntityNotFoundExceptionWhenDeletingPullSubscription() throws Exception {
lenient().when(factory.getManager()).thenReturn(serviceBusManager);
lenient().when(factory.getManager(dataPartitionId)).thenReturn(serviceBusManager);
when(serviceBusManager.deleteSubscription(topicName, subscriptionId)).thenThrow(new MessagingEntityNotFoundException(errorMessage));
AppException exception = assertThrows(AppException.class, () -> {
......@@ -142,13 +152,13 @@ public class PullSubscriptionTest {
assertNotNull(exception);
assertEquals(404, exception.getError().getCode());
assertEquals(String.format("Pull Subscription with id %s does not exist.", subscriptionId), exception.getError().getMessage());
verify(factory, times(1)).getManager();
verify(factory, times(1)).getManager(dataPartitionId);
verify(serviceBusManager, times(1)).deleteSubscription(topicName, subscriptionId);
}
@Test
public void shouldThrow500ExceptionWhenDeletingPullSubscription() throws ServiceBusException, InterruptedException {
lenient().when(factory.getManager()).thenReturn(serviceBusManager);
lenient().when(factory.getManager(dataPartitionId)).thenReturn(serviceBusManager);
when(serviceBusManager.deleteSubscription(topicName, subscriptionId)).thenThrow(new ServiceBusException(true, SERVICE_BUS_ERROR_MESSAGE));
AppException exception = assertThrows(AppException.class, () -> {
......@@ -158,14 +168,14 @@ public class PullSubscriptionTest {
assertEquals(500, exception.getError().getCode());
assertEquals("Server Error", exception.getError().getReason());
assertEquals("Unexpected error deleting Pull subscription", exception.getError().getMessage());
verify(factory, times(1)).getManager();
verify(factory, times(1)).getManager(dataPartitionId);
verify(serviceBusManager, times(1)).deleteSubscription(topicName, subscriptionId);
verify(logger, times(1)).error("Deleting Pull Subscription failed with error: " + new ServiceBusException(true, SERVICE_BUS_ERROR_MESSAGE).toString());
}
@Test
public void shouldThrow500NullPointerExceptionWhenDeletingPullSubscription() throws ServiceBusException, InterruptedException {
lenient().when(factory.getManager()).thenThrow(new AppException(500, "Null Pointer Exception", MANAGEMENT_CLIENT_ERROR_MESSAGE));
lenient().when(factory.getManager(dataPartitionId)).thenThrow(new AppException(500, "Null Pointer Exception", MANAGEMENT_CLIENT_ERROR_MESSAGE));
AppException exception = assertThrows(AppException.class, () -> {
pullSubscription.deleteSubscription(subscriptionId, topicName);
......@@ -175,20 +185,20 @@ public class PullSubscriptionTest {
assertEquals(500, exception.getError().getCode());
assertEquals("Null Pointer Exception", exception.getError().getReason());
assertEquals(MANAGEMENT_CLIENT_ERROR_MESSAGE, exception.getError().getMessage());
verify(factory, times(1)).getManager();
verify(factory, times(1)).getManager(dataPartitionId);
verify(serviceBusManager, times(0)).deleteSubscription(topicName, subscriptionId);
}
@Test
public void shouldGetPullSubscription() throws ServiceBusException, InterruptedException {
lenient().when(factory.getManager()).thenReturn(serviceBusManager);
lenient().when(factory.getManager(dataPartitionId)).thenReturn(serviceBusManager);
SubscriptionDescription subscriptionDescription = new SubscriptionDescription(topicName, subscriptionId);
when(serviceBusManager.getSubscription(topicName, subscriptionId)).thenReturn(subscriptionDescription);
pullSubscription.checkIfSubscriptionExists(subscriptionId, topicName);
verify(factory, times(1)).getManager();
verify(factory, times(1)).getManager(dataPartitionId);
verify(serviceBusManager, times(1)).getSubscription(topicName, subscriptionId);
verify(logger, times(1)).debug(String.format("Pull Subscription with id %s fetched successfully", subscriptionId));
}
......@@ -196,7 +206,7 @@ public class PullSubscriptionTest {
@Test
public void shouldThrow500NullPointerExceptionWhenFetchingPullSubscription() throws ServiceBusException, InterruptedException {
lenient().when(factory.getManager()).thenThrow(new AppException(500, "Null Pointer Exception", MANAGEMENT_CLIENT_ERROR_MESSAGE));
lenient().when(factory.getManager(dataPartitionId)).thenThrow(new AppException(500, "Null Pointer Exception", MANAGEMENT_CLIENT_ERROR_MESSAGE));
AppException exception = assertThrows(AppException.class, () -> {
pullSubscription.checkIfSubscriptionExists(subscriptionId, topicName);
......@@ -206,13 +216,13 @@ public class PullSubscriptionTest {
assertEquals(500, exception.getError().getCode());
assertEquals("Null Pointer Exception", exception.getError().getReason());
assertEquals(MANAGEMENT_CLIENT_ERROR_MESSAGE, exception.getError().getMessage());
verify(factory, times(1)).getManager();
verify(factory, times(1)).getManager(dataPartitionId);
verify(serviceBusManager, times(0)).getSubscription(topicName, subscriptionId);
}
@Test
public void shouldThrowNotFoundExceptionExceptionWhenFetchingPullSubscription() throws ServiceBusException, InterruptedException {
lenient().when(factory.getManager()).thenReturn(serviceBusManager);
lenient().when(factory.getManager(dataPartitionId)).thenReturn(serviceBusManager);
when(serviceBusManager.getSubscription(topicName, subscriptionId)).thenThrow(new MessagingEntityNotFoundException());
AppException exception = assertThrows(AppException.class, () -> {
......@@ -229,7 +239,7 @@ public class PullSubscriptionTest {
@Test
public void shouldThrow500ExceptionWhenFetchingPullSubscription() throws ServiceBusException, InterruptedException {
lenient().when(factory.getManager()).thenReturn(serviceBusManager);
lenient().when(factory.getManager(dataPartitionId)).thenReturn(serviceBusManager);
when(serviceBusManager.getSubscription(topicName, subscriptionId)).thenThrow(new ServiceBusException(true, SERVICE_BUS_ERROR_MESSAGE));
AppException exception = assertThrows(AppException.class, () -> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment