Skip to content

Commit 43eaec5

Browse files
committed
- code linting
1 parent c9f619e commit 43eaec5

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/main/java/com/microsoft/graph/content/BatchResponseContent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public BatchResponseContent(@Nonnull Response batchResponse, @Nullable Map<Strin
4949
* @return The responses of the batch request.
5050
*/
5151
@Nonnull
52-
public HashMap<String, Response> getResponses() {
52+
public Map<String, Response> getResponses() {
5353
HashMap<String, Response> responses = new HashMap<>();
5454
jsonBatchResponseObject = jsonBatchResponseObject != null ? jsonBatchResponseObject : getBatchResponseContent();
5555
if (jsonBatchResponseObject != null) {
@@ -68,7 +68,7 @@ public HashMap<String, Response> getResponses() {
6868
* @return The status codes of the responses of the batch request.
6969
*/
7070
@Nonnull
71-
public HashMap<String, Integer> getResponsesStatusCode() {
71+
public Map<String, Integer> getResponsesStatusCode() {
7272
HashMap<String, Integer> statusCodes = new HashMap<>();
7373
jsonBatchResponseObject = jsonBatchResponseObject != null ? jsonBatchResponseObject : getBatchResponseContent();
7474
if (jsonBatchResponseObject != null) {

src/main/java/com/microsoft/graph/content/BatchResponseContentCollection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public InputStream getResponseStreamById(@Nonnull String requestId) {
100100
public Map<String, Integer> getResponsesStatusCodes() {
101101
HashMap<String, Integer> statusCodes = new HashMap<>();
102102
for(KeyedBatchResponseContent keyedResponse : batchResponses) {
103-
HashMap<String, Integer> responseStatusCodes = keyedResponse.response.getResponsesStatusCode();
103+
Map<String, Integer> responseStatusCodes = keyedResponse.response.getResponsesStatusCode();
104104
statusCodes.putAll(responseStatusCodes);
105105
}
106106
return statusCodes;

src/main/java/com/microsoft/graph/requests/ResponseBodyHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public ResponseBodyHandler(@Nonnull ParsableFactory<T> factory) {
4545
* @param <NativeResponseType> The type of the native response object.
4646
* @param <ModelType> The type of the response model object.
4747
*/
48-
@Nonnull
48+
@Nullable
4949
@Override
5050
public <NativeResponseType, ModelType> ModelType handleResponse(@Nonnull NativeResponseType response, @Nullable HashMap<String, ParsableFactory<? extends Parsable>> errorMappings) {
5151
if(response instanceof Response && ((Response) response).body()!=null) {

src/test/java/com/microsoft/graph/content/BatchResponseContentTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.io.InputStream;
1414
import java.net.HttpURLConnection;
1515
import java.util.HashMap;
16+
import java.util.Map;
1617

1718
import static com.microsoft.kiota.serialization.ParseNodeFactoryRegistry.defaultInstance;
1819
import static org.junit.jupiter.api.Assertions.*;
@@ -26,7 +27,7 @@ class BatchResponseContentTest {
2627
void BatchResponseContent_InitializeWithNoContent() {
2728
Response response = defaultBuilder.code(HttpURLConnection.HTTP_BAD_REQUEST).build();
2829
BatchResponseContent batchResponseContent = new BatchResponseContent(response);
29-
HashMap<String, Response> responses = batchResponseContent.getResponses();
30+
Map<String, Response> responses = batchResponseContent.getResponses();
3031
Response response1 = responses.get("1");
3132
assertNotNull(responses);
3233
assertNull(response1);
@@ -38,7 +39,7 @@ void BatchResponseContent_InitializeWithEmptyResponseContent() {
3839
ResponseBody responseBody = ResponseBody.create(jsonResponse,MediaType.get("application/json"));
3940
Response response = defaultBuilder.code(HttpURLConnection.HTTP_BAD_REQUEST).body(responseBody).build();
4041
BatchResponseContent batchResponseContent = new BatchResponseContent(response);
41-
HashMap<String, Response> responses = batchResponseContent.getResponses();
42+
Map<String, Response> responses = batchResponseContent.getResponses();
4243
Response response1 = batchResponseContent.getResponseById("1");
4344
assertNotNull(responses);
4445
assertNull(response1);
@@ -77,7 +78,7 @@ void BatchResponseContent_GetResponses() {
7778
Response response = defaultBuilder.code(HttpURLConnection.HTTP_OK).body(body).build();
7879
BatchResponseContent batchResponseContent = new BatchResponseContent(response);
7980

80-
HashMap<String, Response> responses = batchResponseContent.getResponses();
81+
Map<String, Response> responses = batchResponseContent.getResponses();
8182

8283
assertNotNull(responses);
8384
assertEquals(3, responses.size());

0 commit comments

Comments
 (0)