From f6594b057a8b469cd09f0eeb48feb0fdc15057e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Apr 2022 08:04:16 +0000 Subject: [PATCH 01/20] Bump github/codeql-action from 1 to 2 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v1...v2) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 9e8a1c2d8..a18d65d41 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -35,7 +35,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 # Override language selection by uncommenting this and choosing your languages with: languages: java @@ -43,7 +43,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -57,4 +57,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 From 7a7616e515c4936b5679892b24d219d6d442b9e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Apr 2022 08:03:17 +0000 Subject: [PATCH 02/20] Bump rickstaa/action-create-tag from 1.2.2 to 1.3.1 Bumps [rickstaa/action-create-tag](https://github.com/rickstaa/action-create-tag) from 1.2.2 to 1.3.1. - [Release notes](https://github.com/rickstaa/action-create-tag/releases) - [Changelog](https://github.com/rickstaa/action-create-tag/blob/main/CHANGELOG.md) - [Commits](https://github.com/rickstaa/action-create-tag/compare/v1.2.2...v1.3.1) --- updated-dependencies: - dependency-name: rickstaa/action-create-tag dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/build-and-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 5e8ed15d1..222df1118 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -105,7 +105,7 @@ jobs: run: .\scripts\getLatestVersion.ps1 shell: pwsh - name: Create tag - uses: rickstaa/action-create-tag@v1.2.2 + uses: rickstaa/action-create-tag@v1.3.1 with: tag: ${{ steps.GetVersion.outputs.tag }} - name: Queue Git Release From c06514475adc62f76c4b80bca42feab409185b7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 08:02:07 +0000 Subject: [PATCH 03/20] Bump spotbugs-annotations from 4.6.0 to 4.7.0 Bumps [spotbugs-annotations](https://github.com/spotbugs/spotbugs) from 4.6.0 to 4.7.0. - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.6.0...4.7.0) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-annotations dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- gradle/dependencies.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 774ed2ad8..0d73a18ca 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -13,7 +13,7 @@ dependencies { api 'com.azure:azure-core:1.27.0' compileOnly 'net.jcip:jcip-annotations:1.0' - compileOnly 'com.github.spotbugs:spotbugs-annotations:4.6.0' + compileOnly 'com.github.spotbugs:spotbugs-annotations:4.7.0' testCompileOnly 'net.jcip:jcip-annotations:1.0' - testCompileOnly 'com.github.spotbugs:spotbugs-annotations:4.5.3' + testCompileOnly 'com.github.spotbugs:spotbugs-annotations:4.7.0' } \ No newline at end of file From 83cd70829f343d21a4f78c80b2ed5f1a9bce5923 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 08:25:06 +0000 Subject: [PATCH 04/20] Bump spotbugs-annotations from 4.6.0 to 4.7.0 in /android Bumps [spotbugs-annotations](https://github.com/spotbugs/spotbugs) from 4.6.0 to 4.7.0. - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.6.0...4.7.0) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-annotations dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- gradle/dependencies.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 774ed2ad8..0d73a18ca 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -13,7 +13,7 @@ dependencies { api 'com.azure:azure-core:1.27.0' compileOnly 'net.jcip:jcip-annotations:1.0' - compileOnly 'com.github.spotbugs:spotbugs-annotations:4.6.0' + compileOnly 'com.github.spotbugs:spotbugs-annotations:4.7.0' testCompileOnly 'net.jcip:jcip-annotations:1.0' - testCompileOnly 'com.github.spotbugs:spotbugs-annotations:4.5.3' + testCompileOnly 'com.github.spotbugs:spotbugs-annotations:4.7.0' } \ No newline at end of file From b831f8c044a55d141e217c3f68b24204ec862c88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 May 2022 08:03:56 +0000 Subject: [PATCH 05/20] Bump azure-core from 1.27.0 to 1.28.0 Bumps [azure-core](https://github.com/Azure/azure-sdk-for-java) from 1.27.0 to 1.28.0. - [Release notes](https://github.com/Azure/azure-sdk-for-java/releases) - [Commits](https://github.com/Azure/azure-sdk-for-java/compare/azure-core_1.27.0...azure-core_1.28.0) --- updated-dependencies: - dependency-name: com.azure:azure-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- gradle/dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 0d73a18ca..7c4e6e442 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -10,7 +10,7 @@ dependencies { implementation 'com.google.guava:guava:31.1-jre' implementation 'com.google.code.gson:gson:2.9.0' - api 'com.azure:azure-core:1.27.0' + api 'com.azure:azure-core:1.28.0' compileOnly 'net.jcip:jcip-annotations:1.0' compileOnly 'com.github.spotbugs:spotbugs-annotations:4.7.0' From e2b6f5f1141b3ff073f54c91000e7b67afb4e429 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 May 2022 08:14:52 +0000 Subject: [PATCH 06/20] Bump azure-core from 1.27.0 to 1.28.0 Bumps [azure-core](https://github.com/Azure/azure-sdk-for-java) from 1.27.0 to 1.28.0. - [Release notes](https://github.com/Azure/azure-sdk-for-java/releases) - [Commits](https://github.com/Azure/azure-sdk-for-java/compare/azure-core_1.27.0...azure-core_1.28.0) --- updated-dependencies: - dependency-name: com.azure:azure-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 68c881457..11169fab4 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ com.azure azure-core - 1.27.0 + 1.28.0 org.junit.jupiter From c9d1a574d09e0e27233540883f0bc16285e3180d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 May 2022 08:36:10 +0000 Subject: [PATCH 07/20] Bump azure-core from 1.27.0 to 1.28.0 in /android Bumps [azure-core](https://github.com/Azure/azure-sdk-for-java) from 1.27.0 to 1.28.0. - [Release notes](https://github.com/Azure/azure-sdk-for-java/releases) - [Commits](https://github.com/Azure/azure-sdk-for-java/compare/azure-core_1.27.0...azure-core_1.28.0) --- updated-dependencies: - dependency-name: com.azure:azure-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- gradle/dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 0d73a18ca..7c4e6e442 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -10,7 +10,7 @@ dependencies { implementation 'com.google.guava:guava:31.1-jre' implementation 'com.google.code.gson:gson:2.9.0' - api 'com.azure:azure-core:1.27.0' + api 'com.azure:azure-core:1.28.0' compileOnly 'net.jcip:jcip-annotations:1.0' compileOnly 'com.github.spotbugs:spotbugs-annotations:4.7.0' From 7325a08de4e38e2960facd4a75823afb045cac24 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 May 2022 08:36:11 +0000 Subject: [PATCH 08/20] Bump azure-identity from 1.5.0 to 1.5.1 in /samples/deviceCodeSample Bumps [azure-identity](https://github.com/Azure/azure-sdk-for-java) from 1.5.0 to 1.5.1. - [Release notes](https://github.com/Azure/azure-sdk-for-java/releases) - [Commits](https://github.com/Azure/azure-sdk-for-java/compare/azure-core_1.5.0...azure-core_1.5.1) --- updated-dependencies: - dependency-name: com.azure:azure-identity dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- samples/deviceCodeSample/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/deviceCodeSample/build.gradle b/samples/deviceCodeSample/build.gradle index 963fbd770..c22b570b1 100644 --- a/samples/deviceCodeSample/build.gradle +++ b/samples/deviceCodeSample/build.gradle @@ -12,5 +12,5 @@ repositories { dependencies { testImplementation group: 'junit', name: 'junit', version: '4.13.2' implementation project(':coreLibrary') - implementation 'com.azure:azure-identity:1.5.0' + implementation 'com.azure:azure-identity:1.5.1' } From 29eaa167e86fae8269c01535987b309f6e05dbd8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 May 2022 11:13:48 +0000 Subject: [PATCH 09/20] Bump azure-identity in /samples/interactiveBrowserSample Bumps [azure-identity](https://github.com/Azure/azure-sdk-for-java) from 1.5.0 to 1.5.1. - [Release notes](https://github.com/Azure/azure-sdk-for-java/releases) - [Commits](https://github.com/Azure/azure-sdk-for-java/compare/azure-core_1.5.0...azure-core_1.5.1) --- updated-dependencies: - dependency-name: com.azure:azure-identity dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- samples/interactiveBrowserSample/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/interactiveBrowserSample/build.gradle b/samples/interactiveBrowserSample/build.gradle index 963fbd770..c22b570b1 100644 --- a/samples/interactiveBrowserSample/build.gradle +++ b/samples/interactiveBrowserSample/build.gradle @@ -12,5 +12,5 @@ repositories { dependencies { testImplementation group: 'junit', name: 'junit', version: '4.13.2' implementation project(':coreLibrary') - implementation 'com.azure:azure-identity:1.5.0' + implementation 'com.azure:azure-identity:1.5.1' } From c67a57d0ac2402a361d648ad99ebd4d08fe714d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 08:33:25 +0000 Subject: [PATCH 10/20] Bump gradle from 7.1.3 to 7.2.0 in /android Bumps gradle from 7.1.3 to 7.2.0. --- updated-dependencies: - dependency-name: com.android.tools.build:gradle dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 89c672627..512462ee3 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -9,7 +9,7 @@ buildscript { dependencies { classpath "com.gradle:gradle-enterprise-gradle-plugin:3.10" - classpath "com.android.tools.build:gradle:7.1.3" + classpath "com.android.tools.build:gradle:7.2.0" classpath "com.github.ben-manes:gradle-versions-plugin:0.42.0" } } From 7af78faa111f1bc1f56bc64691c13c10ee32efa8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 May 2022 08:04:07 +0000 Subject: [PATCH 11/20] Bump com.github.spotbugs from 5.0.6 to 5.0.7 Bumps com.github.spotbugs from 5.0.6 to 5.0.7. --- updated-dependencies: - dependency-name: com.github.spotbugs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 808a7db0f..dc2e30692 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ plugins { id 'maven-publish' id 'signing' id 'jacoco' - id 'com.github.spotbugs' version '5.0.6' + id 'com.github.spotbugs' version '5.0.7' id "org.sonarqube" version "3.3" } From 50dc24f52bce31a4c352331568ebf65924b6a6e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 May 2022 08:23:49 +0000 Subject: [PATCH 12/20] Bump gradle-enterprise-gradle-plugin from 3.10 to 3.10.1 in /android Bumps gradle-enterprise-gradle-plugin from 3.10 to 3.10.1. --- updated-dependencies: - dependency-name: com.gradle:gradle-enterprise-gradle-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 512462ee3..527b5df1f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath "com.gradle:gradle-enterprise-gradle-plugin:3.10" + classpath "com.gradle:gradle-enterprise-gradle-plugin:3.10.1" classpath "com.android.tools.build:gradle:7.2.0" classpath "com.github.ben-manes:gradle-versions-plugin:0.42.0" } From fe547eb02afb360f366ce434a4e76724d0aa3bd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 May 2022 08:05:08 +0000 Subject: [PATCH 13/20] Bump rickstaa/action-create-tag from 1.3.1 to 1.3.2 Bumps [rickstaa/action-create-tag](https://github.com/rickstaa/action-create-tag) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/rickstaa/action-create-tag/releases) - [Changelog](https://github.com/rickstaa/action-create-tag/blob/main/CHANGELOG.md) - [Commits](https://github.com/rickstaa/action-create-tag/compare/v1.3.1...v1.3.2) --- updated-dependencies: - dependency-name: rickstaa/action-create-tag dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/build-and-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 222df1118..df0b19c3a 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -105,7 +105,7 @@ jobs: run: .\scripts\getLatestVersion.ps1 shell: pwsh - name: Create tag - uses: rickstaa/action-create-tag@v1.3.1 + uses: rickstaa/action-create-tag@v1.3.2 with: tag: ${{ steps.GetVersion.outputs.tag }} - name: Queue Git Release From 57891a8e62e0edf8684a723719edd0480016bf57 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 25 May 2022 14:14:29 -0400 Subject: [PATCH 14/20] - bumps the android tooling version to unlock CI Signed-off-by: Vincent Biret --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 527b5df1f..5c0347ded 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -9,7 +9,7 @@ buildscript { dependencies { classpath "com.gradle:gradle-enterprise-gradle-plugin:3.10.1" - classpath "com.android.tools.build:gradle:7.2.0" + classpath "com.android.tools.build:gradle:7.2.1" classpath "com.github.ben-manes:gradle-versions-plugin:0.42.0" } } From b1003c3c7c93be6a8899c21e5c6c95530741c845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Kov=C3=A1=C4=8D?= Date: Wed, 25 May 2022 19:08:35 +0200 Subject: [PATCH 15/20] Log message of GraphServiceException only once gh-480 --- src/main/java/com/microsoft/graph/http/CoreHttpProvider.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/microsoft/graph/http/CoreHttpProvider.java b/src/main/java/com/microsoft/graph/http/CoreHttpProvider.java index 8fd8be582..b7638a084 100644 --- a/src/main/java/com/microsoft/graph/http/CoreHttpProvider.java +++ b/src/main/java/com/microsoft/graph/http/CoreHttpProvider.java @@ -28,7 +28,6 @@ import com.microsoft.graph.httpcore.middlewareoption.RedirectOptions; import com.microsoft.graph.httpcore.middlewareoption.RetryOptions; import com.microsoft.graph.logger.ILogger; -import com.microsoft.graph.logger.LoggerLevel; import com.microsoft.graph.options.HeaderOption; import com.microsoft.graph.serializer.ISerializer; @@ -489,8 +488,7 @@ private Result processResponse(final Response re } } } catch (final GraphServiceException ex) { - final boolean shouldLogVerbosely = logger.getLoggingLevel() == LoggerLevel.DEBUG; - logger.logError("Graph service exception " + ex.getMessage(shouldLogVerbosely), ex); + logger.logError("Graph service exception", ex); throw ex; } catch (final Exception ex) { final ClientException clientException = new ClientException("Error during http request", From cc485f498f0d1f0aeee0f5dc0d2879202832e0f0 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 25 May 2022 13:59:45 -0400 Subject: [PATCH 16/20] - adds changelog entry for error message fix --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4438e123e..6f91b6eec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Fixed an issue where the error message would be logged twice. #514 + ## [2.0.12] - 2022-04-22 ### Added From 9e5890f424129d7a08412b7c835df13ddb269371 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Thu, 26 May 2022 03:30:22 -0700 Subject: [PATCH 17/20] Suppress FB Warnings on Tests, Make some Exceptions Explicit --- .../graph/http/IStatefulResponseHandler.java | 8 ++++++-- .../tasks/LargeFileUploadResponseHandler.java | 2 +- .../microsoft/graph/tasks/LargeFileUploadTask.java | 5 ++++- .../TokenCredentialAuthProviderTest.java | 2 ++ .../graph/content/BatchRequestContentTest.java | 2 ++ .../graph/content/BatchResponseContentTest.java | 2 ++ .../com/microsoft/graph/core/BaseClientTests.java | 2 +- .../microsoft/graph/core/ClientExceptionTests.java | 2 +- .../graph/core/GraphServiceClientTest.java | 2 ++ .../graph/http/BaseCollectionPageTests.java | 2 +- .../graph/http/BaseCollectionRequestTests.java | 2 ++ .../graph/http/BaseRequestBuilderTests.java | 2 +- .../com/microsoft/graph/http/BaseRequestTests.java | 2 ++ .../graph/http/BaseStreamRequestTests.java | 4 +++- .../http/CoreHttpCallbackFutureWrapperTests.java | 2 ++ .../graph/http/CoreHttpProviderTests.java | 3 +++ .../graph/httpcore/AuthenticationHandlerTest.java | 2 ++ .../microsoft/graph/httpcore/RetryHandlerTest.java | 2 ++ .../middlewareoption/RedirectOptionsTest.java | 2 ++ .../middlewareoption/RetryOptionsTest.java | 5 ++++- .../com/microsoft/graph/options/OptionTests.java | 2 ++ .../graph/serializer/ByteArraySerializerTests.java | 4 +++- .../microsoft/graph/serializer/DateOnlyTests.java | 2 ++ .../microsoft/graph/serializer/DurationTests.java | 2 ++ .../serializer/EdmNativeTypeSerializerTests.java | 14 +++++++------- .../microsoft/graph/serializer/ISO8601Test.java | 5 +++-- .../serializer/OffsetDateTimeSerializerTests.java | 7 ++++--- .../microsoft/graph/serializer/TimeOfDayTests.java | 4 +++- 28 files changed, 71 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/microsoft/graph/http/IStatefulResponseHandler.java b/src/main/java/com/microsoft/graph/http/IStatefulResponseHandler.java index 893691a86..3d5bba8ed 100644 --- a/src/main/java/com/microsoft/graph/http/IStatefulResponseHandler.java +++ b/src/main/java/com/microsoft/graph/http/IStatefulResponseHandler.java @@ -25,9 +25,11 @@ import com.microsoft.graph.logger.ILogger; import com.microsoft.graph.serializer.ISerializer; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import javax.annotation.Nullable; import javax.annotation.Nonnull; +import java.io.IOException; /** * The handler interface for requests having stateful response from server. @@ -47,11 +49,13 @@ public interface IStatefulResponseHandler { * @param logger the logger * @param the native http client response type * @return the result generated by this handler - * @throws Exception an exception occurs if the request was unable to complete for any reason + * @throws IOException an exception occurs if the request was unable to complete for any reason + * @throws GraphServiceException an exception is there is an interruption related to the GraphService */ @Nullable + @SuppressFBWarnings ResultType generateResult(@Nonnull final IHttpRequest request, @Nonnull final ResponseType response, @Nonnull final ISerializer serializer, - @Nonnull final ILogger logger) throws Exception; + @Nonnull final ILogger logger) throws IOException, GraphServiceException; } diff --git a/src/main/java/com/microsoft/graph/tasks/LargeFileUploadResponseHandler.java b/src/main/java/com/microsoft/graph/tasks/LargeFileUploadResponseHandler.java index 9d28bbdb4..0a1c69213 100644 --- a/src/main/java/com/microsoft/graph/tasks/LargeFileUploadResponseHandler.java +++ b/src/main/java/com/microsoft/graph/tasks/LargeFileUploadResponseHandler.java @@ -76,7 +76,7 @@ public LargeFileUploadResponse generateResult( @Nonnull final IHttpRequest request, @Nonnull final ResponseType response, @Nonnull final ISerializer serializer, - @Nonnull final ILogger logger) throws Exception { + @Nonnull final ILogger logger) throws IOException, GraphServiceException { Objects.requireNonNull(request, "parameter request cannot be null"); Objects.requireNonNull(response, "parameter response cannot be null"); Objects.requireNonNull(serializer, "parameter serializer cannot be null"); diff --git a/src/main/java/com/microsoft/graph/tasks/LargeFileUploadTask.java b/src/main/java/com/microsoft/graph/tasks/LargeFileUploadTask.java index 78da111b2..72b8f3c1d 100644 --- a/src/main/java/com/microsoft/graph/tasks/LargeFileUploadTask.java +++ b/src/main/java/com/microsoft/graph/tasks/LargeFileUploadTask.java @@ -24,6 +24,8 @@ import com.microsoft.graph.core.ClientException; import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.GraphFatalServiceException; +import com.microsoft.graph.http.GraphServiceException; import com.microsoft.graph.options.Option; import java.io.IOException; @@ -98,12 +100,13 @@ public class LargeFileUploadTask { * @param inputStream the input stream * @param streamSize the stream size * @param uploadTypeClass the upload type class + * @throws GraphServiceException if there is an interruption in the service */ public LargeFileUploadTask(@Nonnull final IUploadSession uploadSession, @Nonnull final IBaseClient client, @Nonnull final InputStream inputStream, final long streamSize, - @Nonnull final Class uploadTypeClass) { + @Nonnull final Class uploadTypeClass) throws GraphServiceException { Objects.requireNonNull(uploadSession, "Upload session is null."); if (streamSize <= 0) { diff --git a/src/test/java/com/microsoft/graph/authentication/TokenCredentialAuthProviderTest.java b/src/test/java/com/microsoft/graph/authentication/TokenCredentialAuthProviderTest.java index 6868eb01c..0c2a53f40 100644 --- a/src/test/java/com/microsoft/graph/authentication/TokenCredentialAuthProviderTest.java +++ b/src/test/java/com/microsoft/graph/authentication/TokenCredentialAuthProviderTest.java @@ -3,6 +3,7 @@ import com.azure.core.credential.TokenCredential; import com.microsoft.graph.mocks.MockTokenCredential; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; @@ -13,6 +14,7 @@ import java.util.ArrayList; import java.util.concurrent.ExecutionException; +@SuppressFBWarnings public class TokenCredentialAuthProviderTest { private static final String testToken = "CredentialTestToken"; diff --git a/src/test/java/com/microsoft/graph/content/BatchRequestContentTest.java b/src/test/java/com/microsoft/graph/content/BatchRequestContentTest.java index 827ebb862..e39e0426f 100644 --- a/src/test/java/com/microsoft/graph/content/BatchRequestContentTest.java +++ b/src/test/java/com/microsoft/graph/content/BatchRequestContentTest.java @@ -29,6 +29,7 @@ import com.microsoft.graph.serializer.IJsonBackedObject; import com.microsoft.graph.serializer.ISerializer; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -41,6 +42,7 @@ import okhttp3.Response; import okhttp3.ResponseBody; +@SuppressFBWarnings class BatchRequestContentTest { String testurl = "http://graph.microsoft.com/v1.0/me"; diff --git a/src/test/java/com/microsoft/graph/content/BatchResponseContentTest.java b/src/test/java/com/microsoft/graph/content/BatchResponseContentTest.java index a39b9255b..1384e1a07 100644 --- a/src/test/java/com/microsoft/graph/content/BatchResponseContentTest.java +++ b/src/test/java/com/microsoft/graph/content/BatchResponseContentTest.java @@ -20,8 +20,10 @@ import com.microsoft.graph.serializer.DefaultSerializer; import com.microsoft.graph.serializer.ISerializer; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; +@SuppressFBWarnings public class BatchResponseContentTest { @Test public void testValidBatchResponseContent() { diff --git a/src/test/java/com/microsoft/graph/core/BaseClientTests.java b/src/test/java/com/microsoft/graph/core/BaseClientTests.java index 3d853e493..924b6eb6d 100644 --- a/src/test/java/com/microsoft/graph/core/BaseClientTests.java +++ b/src/test/java/com/microsoft/graph/core/BaseClientTests.java @@ -38,7 +38,7 @@ public class BaseClientTests { private ISerializer mSerializer; @BeforeEach - public void setUp() throws Exception { + public void setUp() { baseClient = new BaseClient<>(); mLogger = mock(ILogger.class); mSerializer = mock(ISerializer.class); diff --git a/src/test/java/com/microsoft/graph/core/ClientExceptionTests.java b/src/test/java/com/microsoft/graph/core/ClientExceptionTests.java index 62b68a7c2..603588d8c 100644 --- a/src/test/java/com/microsoft/graph/core/ClientExceptionTests.java +++ b/src/test/java/com/microsoft/graph/core/ClientExceptionTests.java @@ -12,7 +12,7 @@ public class ClientExceptionTests { private String expectMessage = "This is test exception message"; @BeforeEach - public void setUp() throws Exception { + public void setUp() { clientException = new ClientException(expectMessage, null); } diff --git a/src/test/java/com/microsoft/graph/core/GraphServiceClientTest.java b/src/test/java/com/microsoft/graph/core/GraphServiceClientTest.java index 14c211583..0e19c46b3 100644 --- a/src/test/java/com/microsoft/graph/core/GraphServiceClientTest.java +++ b/src/test/java/com/microsoft/graph/core/GraphServiceClientTest.java @@ -12,6 +12,7 @@ import java.util.Map; import java.util.concurrent.CompletableFuture; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; import okhttp3.Request; @@ -28,6 +29,7 @@ import javax.annotation.Nullable; +@SuppressFBWarnings public class GraphServiceClientTest { private IAuthenticationProvider getAuthProvider() { return mock(IAuthenticationProvider.class); diff --git a/src/test/java/com/microsoft/graph/http/BaseCollectionPageTests.java b/src/test/java/com/microsoft/graph/http/BaseCollectionPageTests.java index 9cf1b7e68..2604aa19c 100644 --- a/src/test/java/com/microsoft/graph/http/BaseCollectionPageTests.java +++ b/src/test/java/com/microsoft/graph/http/BaseCollectionPageTests.java @@ -26,7 +26,7 @@ public class BaseCollectionPageTests { @BeforeEach @SuppressWarnings("unchecked") - public void setUp() throws Exception { + public void setUp() { list = new ArrayList(); list.add("Object1"); list.add("Object2"); diff --git a/src/test/java/com/microsoft/graph/http/BaseCollectionRequestTests.java b/src/test/java/com/microsoft/graph/http/BaseCollectionRequestTests.java index 7865618a9..e9ce66e08 100644 --- a/src/test/java/com/microsoft/graph/http/BaseCollectionRequestTests.java +++ b/src/test/java/com/microsoft/graph/http/BaseCollectionRequestTests.java @@ -10,6 +10,7 @@ import com.microsoft.graph.options.QueryOption; import com.microsoft.graph.serializer.ISerializer; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -56,6 +57,7 @@ public class BaseCollectionRequestTests { private BaseEntityCollectionRequest, BaseCollectionPage>> mRequest; @BeforeEach + @SuppressFBWarnings @SuppressWarnings("unchecked") public void setUp() throws Exception { mBaseClient = mock(IBaseClient.class); diff --git a/src/test/java/com/microsoft/graph/http/BaseRequestBuilderTests.java b/src/test/java/com/microsoft/graph/http/BaseRequestBuilderTests.java index c61caf5f2..b40c0ebef 100644 --- a/src/test/java/com/microsoft/graph/http/BaseRequestBuilderTests.java +++ b/src/test/java/com/microsoft/graph/http/BaseRequestBuilderTests.java @@ -18,7 +18,7 @@ public class BaseRequestBuilderTests { private BaseRequestBuilder baseRequestBuilder; @BeforeEach - public void setUp() throws Exception { + public void setUp() { baseRequestBuilder = new BaseRequestBuilder<>(expectedRequestUrl, mock(IBaseClient.class), null){}; } diff --git a/src/test/java/com/microsoft/graph/http/BaseRequestTests.java b/src/test/java/com/microsoft/graph/http/BaseRequestTests.java index 27c8d95c3..ee615cb3d 100644 --- a/src/test/java/com/microsoft/graph/http/BaseRequestTests.java +++ b/src/test/java/com/microsoft/graph/http/BaseRequestTests.java @@ -11,6 +11,7 @@ import static org.mockito.Mockito.mock; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -37,6 +38,7 @@ public class BaseRequestTests { private BaseRequest mRequest; @BeforeEach + @SuppressFBWarnings public void setUp() throws Exception { final Response response = new Response.Builder() .request(new Request.Builder().url("https://a.b.c").build()) diff --git a/src/test/java/com/microsoft/graph/http/BaseStreamRequestTests.java b/src/test/java/com/microsoft/graph/http/BaseStreamRequestTests.java index bbbfd8f2c..395c768d3 100644 --- a/src/test/java/com/microsoft/graph/http/BaseStreamRequestTests.java +++ b/src/test/java/com/microsoft/graph/http/BaseStreamRequestTests.java @@ -10,6 +10,7 @@ import java.io.InputStream; import java.util.concurrent.ExecutionException; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.stubbing.Answer; @@ -33,13 +34,14 @@ /** * Test cases for {@see BaseStreamRequest} */ +@SuppressFBWarnings public class BaseStreamRequestTests { private BaseClient mBaseClient; @BeforeEach @SuppressWarnings("unchecked") - public void setUp() throws Exception { + public void setUp() { mBaseClient = mock(BaseClient.class); } diff --git a/src/test/java/com/microsoft/graph/http/CoreHttpCallbackFutureWrapperTests.java b/src/test/java/com/microsoft/graph/http/CoreHttpCallbackFutureWrapperTests.java index 83b1d1f54..3458e0894 100644 --- a/src/test/java/com/microsoft/graph/http/CoreHttpCallbackFutureWrapperTests.java +++ b/src/test/java/com/microsoft/graph/http/CoreHttpCallbackFutureWrapperTests.java @@ -9,11 +9,13 @@ import java.io.IOException; import java.util.concurrent.ExecutionException; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; import okhttp3.Call; import okhttp3.Response; +@SuppressFBWarnings class CoreHttpCallbackFutureWrapperTests { @Test diff --git a/src/test/java/com/microsoft/graph/http/CoreHttpProviderTests.java b/src/test/java/com/microsoft/graph/http/CoreHttpProviderTests.java index 43b8ebe76..2ea0ad618 100644 --- a/src/test/java/com/microsoft/graph/http/CoreHttpProviderTests.java +++ b/src/test/java/com/microsoft/graph/http/CoreHttpProviderTests.java @@ -20,6 +20,7 @@ import com.microsoft.graph.serializer.DefaultSerializer; import com.microsoft.graph.serializer.ISerializer; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import okio.Buffer; import org.junit.jupiter.api.Test; @@ -62,6 +63,7 @@ class CoreHttpProviderTests { private Gson GSON = new GsonBuilder().create(); @Test + @SuppressFBWarnings void testErrorResponse() throws Exception { final GraphErrorCodes expectedErrorCode = GraphErrorCodes.INVALID_REQUEST; final String expectedMessage = "Test error!"; @@ -85,6 +87,7 @@ void testErrorResponse() throws Exception { } @Test + @SuppressFBWarnings void testVerboseErrorResponse() throws Exception { final GraphErrorCodes expectedErrorCode = GraphErrorCodes.INVALID_REQUEST; final String expectedMessage = "Test error!"; diff --git a/src/test/java/com/microsoft/graph/httpcore/AuthenticationHandlerTest.java b/src/test/java/com/microsoft/graph/httpcore/AuthenticationHandlerTest.java index 4f77c93e9..a57c91bb2 100644 --- a/src/test/java/com/microsoft/graph/httpcore/AuthenticationHandlerTest.java +++ b/src/test/java/com/microsoft/graph/httpcore/AuthenticationHandlerTest.java @@ -10,6 +10,7 @@ import java.net.URL; import java.util.concurrent.CompletableFuture; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; import okhttp3.OkHttpClient; @@ -17,6 +18,7 @@ public class AuthenticationHandlerTest { @Test + @SuppressFBWarnings public void testAuthenticationHandler() throws Exception { IAuthenticationProvider authProvider = mock(IAuthenticationProvider.class); when(authProvider.getAuthorizationTokenAsync(any(URL.class))).thenReturn(CompletableFuture.completedFuture("a token")); diff --git a/src/test/java/com/microsoft/graph/httpcore/RetryHandlerTest.java b/src/test/java/com/microsoft/graph/httpcore/RetryHandlerTest.java index f786c3e34..c6c1c4817 100644 --- a/src/test/java/com/microsoft/graph/httpcore/RetryHandlerTest.java +++ b/src/test/java/com/microsoft/graph/httpcore/RetryHandlerTest.java @@ -9,6 +9,7 @@ import java.io.IOException; import java.net.HttpURLConnection; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; import com.microsoft.graph.httpcore.middlewareoption.IShouldRetry; @@ -21,6 +22,7 @@ import okhttp3.Response; import okio.BufferedSink; +@SuppressFBWarnings public class RetryHandlerTest { private static final String testmeurl = "https://graph.microsoft.com/v1.0/me"; diff --git a/src/test/java/com/microsoft/graph/httpcore/middlewareoption/RedirectOptionsTest.java b/src/test/java/com/microsoft/graph/httpcore/middlewareoption/RedirectOptionsTest.java index 81be8c023..3e4c8ec6a 100644 --- a/src/test/java/com/microsoft/graph/httpcore/middlewareoption/RedirectOptionsTest.java +++ b/src/test/java/com/microsoft/graph/httpcore/middlewareoption/RedirectOptionsTest.java @@ -5,10 +5,12 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; import okhttp3.Response; +@SuppressFBWarnings public class RedirectOptionsTest { @Test public void constructorDefensiveProgramming() { diff --git a/src/test/java/com/microsoft/graph/httpcore/middlewareoption/RetryOptionsTest.java b/src/test/java/com/microsoft/graph/httpcore/middlewareoption/RetryOptionsTest.java index 91502144d..2ae089484 100644 --- a/src/test/java/com/microsoft/graph/httpcore/middlewareoption/RetryOptionsTest.java +++ b/src/test/java/com/microsoft/graph/httpcore/middlewareoption/RetryOptionsTest.java @@ -3,11 +3,14 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; +@SuppressFBWarnings public class RetryOptionsTest { @Test - public void constructorDefensiveProgramming() { + @SuppressFBWarnings + public void constructorDefensiveProgramming() throws IllegalArgumentException { assertThrows(IllegalArgumentException.class, () -> { new RetryOptions(null, RetryOptions.MAX_RETRIES +1, 0); }); diff --git a/src/test/java/com/microsoft/graph/options/OptionTests.java b/src/test/java/com/microsoft/graph/options/OptionTests.java index 45f163a5a..0f9c07d7e 100644 --- a/src/test/java/com/microsoft/graph/options/OptionTests.java +++ b/src/test/java/com/microsoft/graph/options/OptionTests.java @@ -5,8 +5,10 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; +@SuppressFBWarnings public class OptionTests { @Test diff --git a/src/test/java/com/microsoft/graph/serializer/ByteArraySerializerTests.java b/src/test/java/com/microsoft/graph/serializer/ByteArraySerializerTests.java index 179d39889..1862813ca 100644 --- a/src/test/java/com/microsoft/graph/serializer/ByteArraySerializerTests.java +++ b/src/test/java/com/microsoft/graph/serializer/ByteArraySerializerTests.java @@ -3,12 +3,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; public class ByteArraySerializerTests { @Test - public void testByteSerialization() throws Exception { + public void testByteSerialization() { String expectedString = "abcd"; String serializeString = ByteArraySerializer.serialize(new byte[]{105,-73,29}); assertEquals(expectedString, serializeString); @@ -16,6 +17,7 @@ public void testByteSerialization() throws Exception { } @Test + @SuppressFBWarnings public void testStringDeserialization() throws Exception { byte[] deserializeBytes = ByteArraySerializer.deserialize("abcd"); assertEquals(3, deserializeBytes.length); diff --git a/src/test/java/com/microsoft/graph/serializer/DateOnlyTests.java b/src/test/java/com/microsoft/graph/serializer/DateOnlyTests.java index ad9d9b20d..23d92e8e4 100644 --- a/src/test/java/com/microsoft/graph/serializer/DateOnlyTests.java +++ b/src/test/java/com/microsoft/graph/serializer/DateOnlyTests.java @@ -2,10 +2,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; import com.microsoft.graph.core.DateOnly; +@SuppressFBWarnings public class DateOnlyTests { @Test diff --git a/src/test/java/com/microsoft/graph/serializer/DurationTests.java b/src/test/java/com/microsoft/graph/serializer/DurationTests.java index c691754b6..f833f1445 100644 --- a/src/test/java/com/microsoft/graph/serializer/DurationTests.java +++ b/src/test/java/com/microsoft/graph/serializer/DurationTests.java @@ -5,8 +5,10 @@ import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.Duration; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; +@SuppressFBWarnings public class DurationTests { @Test diff --git a/src/test/java/com/microsoft/graph/serializer/EdmNativeTypeSerializerTests.java b/src/test/java/com/microsoft/graph/serializer/EdmNativeTypeSerializerTests.java index 952fe422a..cffc2733e 100644 --- a/src/test/java/com/microsoft/graph/serializer/EdmNativeTypeSerializerTests.java +++ b/src/test/java/com/microsoft/graph/serializer/EdmNativeTypeSerializerTests.java @@ -11,7 +11,7 @@ public class EdmNativeTypeSerializerTests { @Test - public void testBoolean() throws Exception { + public void testBoolean() { final DefaultSerializer serializer = new DefaultSerializer(new DefaultLogger()); final String source = "{\"@odata.context\":\"https://graph.microsoft.com/v1.0/$metadata#Edm.Null\",\"@odata.null\":true}"; @@ -20,7 +20,7 @@ public void testBoolean() throws Exception { assertEquals(Boolean.valueOf(true), result); } @Test - public void testInteger() throws Exception { + public void testInteger() { final DefaultSerializer serializer = new DefaultSerializer(new DefaultLogger()); final String source = "{\"@odata.context\":\"https://graph.microsoft.com/v1.0/$metadata#Edm.Null\",\"@odata.null\":12}"; @@ -29,7 +29,7 @@ public void testInteger() throws Exception { assertEquals(Integer.valueOf(12), result); } @Test - public void testString() throws Exception { + public void testString() { final DefaultSerializer serializer = new DefaultSerializer(new DefaultLogger()); final String source = "{\"@odata.context\":\"https://graph.microsoft.com/v1.0/$metadata#Edm.Null\",\"@odata.null\":\"toto\"}"; @@ -38,7 +38,7 @@ public void testString() throws Exception { assertEquals("toto", result); } @Test - public void testFloat() throws Exception { + public void testFloat() { final DefaultSerializer serializer = new DefaultSerializer(new DefaultLogger()); final String source = "{\"@odata.context\":\"https://graph.microsoft.com/v1.0/$metadata#Edm.Null\",\"@odata.null\":12.5}"; @@ -47,7 +47,7 @@ public void testFloat() throws Exception { assertEquals(Float.valueOf("12.5"), result); } @Test - public void testLong() throws Exception { + public void testLong() { final DefaultSerializer serializer = new DefaultSerializer(new DefaultLogger()); final String source = "{\"@odata.context\":\"https://graph.microsoft.com/v1.0/$metadata#Edm.Null\",\"@odata.null\":12}"; @@ -56,7 +56,7 @@ public void testLong() throws Exception { assertEquals(Long.valueOf(12), result); } @Test - public void testBigDecimal() throws Exception { + public void testBigDecimal() { final DefaultSerializer serializer = new DefaultSerializer(new DefaultLogger()); final String source = "{\"@odata.context\":\"https://graph.microsoft.com/v1.0/$metadata#Edm.Null\",\"@odata.null\":12}"; @@ -65,7 +65,7 @@ public void testBigDecimal() throws Exception { assertEquals(BigDecimal.valueOf(12), result); } @Test - public void testUUID() throws Exception { + public void testUUID() { final DefaultSerializer serializer = new DefaultSerializer(new DefaultLogger()); final String source = "{\"@odata.context\":\"https://graph.microsoft.com/v1.0/$metadata#Edm.Null\",\"@odata.null\":\"0E6558C3-9640-4385-860A-2A894AC5C246\"}"; diff --git a/src/test/java/com/microsoft/graph/serializer/ISO8601Test.java b/src/test/java/com/microsoft/graph/serializer/ISO8601Test.java index ed8e45eac..1f1315f9e 100644 --- a/src/test/java/com/microsoft/graph/serializer/ISO8601Test.java +++ b/src/test/java/com/microsoft/graph/serializer/ISO8601Test.java @@ -7,16 +7,16 @@ import java.util.Date; import java.util.TimeZone; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; public class ISO8601Test { /** * Make sure that dates with and without millis can be converted properly into strings - * @throws Exception If there is an exception during the test */ @Test - public void testFromDate() throws Exception { + public void testFromDate() { TimeZone.setDefault(TimeZone.getTimeZone("PST")); final OffsetDateTime date = OffsetDateTime.of(5882, 3, 11, 00, 30, 12, 345000000, ZoneOffset.UTC); assertEquals("5882-03-11T00:30:12.345Z", OffsetDateTimeSerializer.serialize(date)); @@ -30,6 +30,7 @@ public void testFromDate() throws Exception { * @throws Exception If there is an exception during the test */ @Test + @SuppressFBWarnings public void testToDate() throws Exception { TimeZone.setDefault(TimeZone.getTimeZone("PST")); final long toTheSecondDate = 123456789012L; diff --git a/src/test/java/com/microsoft/graph/serializer/OffsetDateTimeSerializerTests.java b/src/test/java/com/microsoft/graph/serializer/OffsetDateTimeSerializerTests.java index 9480a36ba..8bbb61dd6 100644 --- a/src/test/java/com/microsoft/graph/serializer/OffsetDateTimeSerializerTests.java +++ b/src/test/java/com/microsoft/graph/serializer/OffsetDateTimeSerializerTests.java @@ -8,6 +8,7 @@ import java.time.ZoneOffset; import java.util.TimeZone; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; /** @@ -16,14 +17,14 @@ * @author mobilal * */ +@SuppressFBWarnings public class OffsetDateTimeSerializerTests { /** * Validate if a offsetDateTime date instance could be serialized - * @throws Exception if offsetDateTime couldn't be serialized - */ + */ @Test - public void testDateSerialization() throws Exception { + public void testDateSerialization() { final OffsetDateTime offsetDateTime = OffsetDateTime.ofInstant(Instant.ofEpochMilli(1561162355000L), ZoneOffset.UTC); final String expected = "2019-06-22T00:12:35Z"; final String actual = OffsetDateTimeSerializer.serialize(offsetDateTime); diff --git a/src/test/java/com/microsoft/graph/serializer/TimeOfDayTests.java b/src/test/java/com/microsoft/graph/serializer/TimeOfDayTests.java index 288c2953c..8a3fbba2b 100644 --- a/src/test/java/com/microsoft/graph/serializer/TimeOfDayTests.java +++ b/src/test/java/com/microsoft/graph/serializer/TimeOfDayTests.java @@ -3,11 +3,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.junit.jupiter.api.Test; import com.microsoft.graph.core.TimeOfDay; import com.microsoft.graph.logger.ILogger; +@SuppressFBWarnings public class TimeOfDayTests { @Test @@ -46,7 +48,7 @@ public void testTimeOfDayDeserializerWithFraction() throws Exception{ assertEquals(44, time.getSecond()); } @Test - public void testTimeOfDaySerialization() throws Exception { + public void testTimeOfDaySerialization() { final TimeOfDay time = new TimeOfDay(12, 30, 44); final ILogger logger = mock(ILogger.class); final ISerializer serializer = new DefaultSerializer(logger); From 52e51ef0dc1c140fcee643fdf6ebdb0c6296fb82 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Thu, 26 May 2022 09:56:19 -0700 Subject: [PATCH 18/20] RollBack breaking changes --- .../com/microsoft/graph/http/IStatefulResponseHandler.java | 7 ++----- .../graph/tasks/LargeFileUploadResponseHandler.java | 4 +++- .../com/microsoft/graph/tasks/LargeFileUploadTask.java | 7 +++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/microsoft/graph/http/IStatefulResponseHandler.java b/src/main/java/com/microsoft/graph/http/IStatefulResponseHandler.java index 3d5bba8ed..5a2206ade 100644 --- a/src/main/java/com/microsoft/graph/http/IStatefulResponseHandler.java +++ b/src/main/java/com/microsoft/graph/http/IStatefulResponseHandler.java @@ -22,14 +22,12 @@ package com.microsoft.graph.http; - import com.microsoft.graph.logger.ILogger; import com.microsoft.graph.serializer.ISerializer; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import javax.annotation.Nullable; import javax.annotation.Nonnull; -import java.io.IOException; /** * The handler interface for requests having stateful response from server. @@ -49,13 +47,12 @@ public interface IStatefulResponseHandler { * @param logger the logger * @param the native http client response type * @return the result generated by this handler - * @throws IOException an exception occurs if the request was unable to complete for any reason - * @throws GraphServiceException an exception is there is an interruption related to the GraphService + * @throws Exception an exception occurs if the request was unable to complete for any reason */ @Nullable @SuppressFBWarnings ResultType generateResult(@Nonnull final IHttpRequest request, @Nonnull final ResponseType response, @Nonnull final ISerializer serializer, - @Nonnull final ILogger logger) throws IOException, GraphServiceException; + @Nonnull final ILogger logger) throws Exception; } diff --git a/src/main/java/com/microsoft/graph/tasks/LargeFileUploadResponseHandler.java b/src/main/java/com/microsoft/graph/tasks/LargeFileUploadResponseHandler.java index 0a1c69213..00b8a6816 100644 --- a/src/main/java/com/microsoft/graph/tasks/LargeFileUploadResponseHandler.java +++ b/src/main/java/com/microsoft/graph/tasks/LargeFileUploadResponseHandler.java @@ -40,6 +40,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import okhttp3.MediaType; import okhttp3.Response; import okhttp3.ResponseBody; @@ -72,11 +73,12 @@ protected LargeFileUploadResponseHandler(@Nonnull final Class upload @Override @Nullable + @SuppressFBWarnings public LargeFileUploadResponse generateResult( @Nonnull final IHttpRequest request, @Nonnull final ResponseType response, @Nonnull final ISerializer serializer, - @Nonnull final ILogger logger) throws IOException, GraphServiceException { + @Nonnull final ILogger logger) throws Exception { Objects.requireNonNull(request, "parameter request cannot be null"); Objects.requireNonNull(response, "parameter response cannot be null"); Objects.requireNonNull(serializer, "parameter serializer cannot be null"); diff --git a/src/main/java/com/microsoft/graph/tasks/LargeFileUploadTask.java b/src/main/java/com/microsoft/graph/tasks/LargeFileUploadTask.java index 72b8f3c1d..f7fabb0e1 100644 --- a/src/main/java/com/microsoft/graph/tasks/LargeFileUploadTask.java +++ b/src/main/java/com/microsoft/graph/tasks/LargeFileUploadTask.java @@ -24,9 +24,8 @@ import com.microsoft.graph.core.ClientException; import com.microsoft.graph.core.IBaseClient; -import com.microsoft.graph.http.GraphFatalServiceException; -import com.microsoft.graph.http.GraphServiceException; import com.microsoft.graph.options.Option; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.IOException; import java.io.InputStream; @@ -100,13 +99,13 @@ public class LargeFileUploadTask { * @param inputStream the input stream * @param streamSize the stream size * @param uploadTypeClass the upload type class - * @throws GraphServiceException if there is an interruption in the service */ + @SuppressFBWarnings public LargeFileUploadTask(@Nonnull final IUploadSession uploadSession, @Nonnull final IBaseClient client, @Nonnull final InputStream inputStream, final long streamSize, - @Nonnull final Class uploadTypeClass) throws GraphServiceException { + @Nonnull final Class uploadTypeClass) { Objects.requireNonNull(uploadSession, "Upload session is null."); if (streamSize <= 0) { From 3e236cea3af0ea39050156cb71f9f5e80e47bccf Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Thu, 26 May 2022 11:16:39 -0700 Subject: [PATCH 19/20] Update CHANGELOG.md --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f91b6eec..5ab1b7859 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +## [2.0.13] - 2022-05-26 + +### Added + +### Changed + - Fixed an issue where the error message would be logged twice. #514 +- Bumps rickstaa/action-create-tag to 1.3.2 #513 +- Bumps Android tooling version to 7.2.1 #515 +- Bumps com.github.spotbugs to 5.0.7 #509 +- Bumps gradle-enterprise-gradle-plugin to 3.10.1 in /android #512 +- Bumps azure-core to 1.28.0 #503, #504, #506 +- Bumps azure-identity to 1.5.1 #505, #507 +- Bumps github/codeql-action to 2 #498 ## [2.0.12] - 2022-04-22 From df07735b71a802e8e9f09011c71396b424f0d9d0 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 26 May 2022 14:24:02 -0400 Subject: [PATCH 20/20] Apply suggestions from code review --- CHANGELOG.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ab1b7859..9fefe01b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,13 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Fixed an issue where the error message would be logged twice. #514 -- Bumps rickstaa/action-create-tag to 1.3.2 #513 -- Bumps Android tooling version to 7.2.1 #515 -- Bumps com.github.spotbugs to 5.0.7 #509 -- Bumps gradle-enterprise-gradle-plugin to 3.10.1 in /android #512 - Bumps azure-core to 1.28.0 #503, #504, #506 - Bumps azure-identity to 1.5.1 #505, #507 -- Bumps github/codeql-action to 2 #498 ## [2.0.12] - 2022-04-22