Skip to content

Commit

Permalink
Merge pull request #518 from microsoftgraph/dev
Browse files Browse the repository at this point in the history
2.0.13
  • Loading branch information
baywet authored May 26, 2022
2 parents b4361e8 + e666efb commit 2e374d8
Show file tree
Hide file tree
Showing 38 changed files with 90 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.2
with:
tag: ${{ steps.GetVersion.outputs.tag }}
- name: Queue Git Release
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ 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

# 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
Expand All @@ -57,4 +57,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ 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 azure-core to 1.28.0 #503, #504, #506
- Bumps azure-identity to 1.5.1 #505, #507

## [2.0.12] - 2022-04-22

### Added
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ buildscript {
}

dependencies {
classpath "com.gradle:gradle-enterprise-gradle-plugin:3.10"
classpath "com.android.tools.build:gradle:7.1.3"
classpath "com.gradle:gradle-enterprise-gradle-plugin:3.10.1"
classpath "com.android.tools.build:gradle:7.2.1"
classpath "com.github.ben-manes:gradle-versions-plugin:0.42.0"
}
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down
6 changes: 3 additions & 3 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ 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.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'
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.27.0</version>
<version>1.28.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
2 changes: 1 addition & 1 deletion samples/deviceCodeSample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
2 changes: 1 addition & 1 deletion samples/interactiveBrowserSample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
4 changes: 1 addition & 3 deletions src/main/java/com/microsoft/graph/http/CoreHttpProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -489,8 +488,7 @@ private <Result, Body, DeserializeType> 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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

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;
Expand All @@ -50,6 +50,7 @@ public interface IStatefulResponseHandler<ResultType, DeserializedType> {
* @throws Exception an exception occurs if the request was unable to complete for any reason
*/
@Nullable
@SuppressFBWarnings
<ResponseType> ResultType generateResult(@Nonnull final IHttpRequest request,
@Nonnull final ResponseType response,
@Nonnull final ISerializer serializer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -72,6 +73,7 @@ protected LargeFileUploadResponseHandler(@Nonnull final Class<UploadType> upload

@Override
@Nullable
@SuppressFBWarnings
public <ResponseType> LargeFileUploadResponse<UploadType> generateResult(
@Nonnull final IHttpRequest request,
@Nonnull final ResponseType response,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.microsoft.graph.core.ClientException;
import com.microsoft.graph.core.IBaseClient;
import com.microsoft.graph.options.Option;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -99,6 +100,7 @@ public class LargeFileUploadTask<UploadType> {
* @param streamSize the stream size
* @param uploadTypeClass the upload type class
*/
@SuppressFBWarnings
public LargeFileUploadTask(@Nonnull final IUploadSession uploadSession,
@Nonnull final IBaseClient<?> client,
@Nonnull final InputStream inputStream,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand All @@ -13,6 +14,7 @@
import java.util.ArrayList;
import java.util.concurrent.ExecutionException;

@SuppressFBWarnings
public class TokenCredentialAuthProviderTest {

private static final String testToken = "CredentialTestToken";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -41,6 +42,7 @@
import okhttp3.Response;
import okhttp3.ResponseBody;

@SuppressFBWarnings
class BatchRequestContentTest {

String testurl = "http://graph.microsoft.com/v1.0/me";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,6 +29,7 @@

import javax.annotation.Nullable;

@SuppressFBWarnings
public class GraphServiceClientTest {
private IAuthenticationProvider getAuthProvider() {
return mock(IAuthenticationProvider.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class BaseCollectionPageTests {

@BeforeEach
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
public void setUp() {
list = new ArrayList<String>();
list.add("Object1");
list.add("Object2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -56,6 +57,7 @@ public class BaseCollectionRequestTests {
private BaseEntityCollectionRequest<JsonObject, ICollectionResponse<JsonObject>, BaseCollectionPage<JsonObject, BaseRequestBuilder<JsonObject>>> mRequest;

@BeforeEach
@SuppressFBWarnings
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
mBaseClient = mock(IBaseClient.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class BaseRequestBuilderTests {
private BaseRequestBuilder<String> baseRequestBuilder;

@BeforeEach
public void setUp() throws Exception {
public void setUp() {
baseRequestBuilder = new BaseRequestBuilder<>(expectedRequestUrl, mock(IBaseClient.class), null){};
}

Expand Down
2 changes: 2 additions & 0 deletions src/test/java/com/microsoft/graph/http/BaseRequestTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -37,6 +38,7 @@ public class BaseRequestTests {
private BaseRequest<JsonObject> mRequest;

@BeforeEach
@SuppressFBWarnings
public void setUp() throws Exception {
final Response response = new Response.Builder()
.request(new Request.Builder().url("https://a.b.c").build())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -33,13 +34,14 @@
/**
* Test cases for {@see BaseStreamRequest}
*/
@SuppressFBWarnings
public class BaseStreamRequestTests {

private BaseClient<Request> mBaseClient;

@BeforeEach
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
public void setUp() {
mBaseClient = mock(BaseClient.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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!";
Expand All @@ -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!";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
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;
import okhttp3.Request;

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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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";
Expand Down
Loading

0 comments on commit 2e374d8

Please sign in to comment.