Repository: firebase/firebase-admin-java
Pull request #373 (2020-02-21 18:57:01)

Bump netty.version from 4.1.34.Final to 4.1.45.Final
Bumps `netty.version` from 4.1.34.Final to 4.1.45.Final.

Updates `netty-codec-http` from 4.1.34.Final to 4.1.45.Final
<details>
<summary>Commits</summary>

- [`136db86`](https://github.com/netty/netty/commit/136db8680afa73c7491277d6fed1e85e703fa905) [maven-release-plugin] prepare release netty-4.1.45.Final
- [`607bc05`](https://github.com/netty/netty/commit/607bc05a2c1453323b2f8c67cbd4aff0d5b17531) Fix BufferOverflowException during non-Unsafe PooledDirectByteBuf resize ([#9912](https://github-redirect.dependabot.com/netty/netty/issues/9912))
- [`ba140ac`](https://github.com/netty/netty/commit/ba140ac6bcf24fdd90d1231ee397ba5a204c17e8) Fix SimpleChannelPoolTest#testCloseAsync() test flake ([#9943](https://github-redirect.dependabot.com/netty/netty/issues/9943))
- [`f7d3573`](https://github.com/netty/netty/commit/f7d357312fa634431aa4af180691cb12efacd902) Add TLS SNI Extension in HTTP/2 Client request. ([#9937](https://github-redirect.dependabot.com/netty/netty/issues/9937))
- [`ac69c87`](https://github.com/netty/netty/commit/ac69c877f1a9857fd8a97c704c882414e66c4920) Fix SniHandlerTest when jdkCompatibilityMode is false ([#9934](https://github-redirect.dependabot.com/netty/netty/issues/9934))
- [`41c47b4`](https://github.com/netty/netty/commit/41c47b41bf0caa2f0faffec901a374516fbd19f7) Fix event loop hang in SniHandler ([#9933](https://github-redirect.dependabot.com/netty/netty/issues/9933))
- [`b82258b`](https://github.com/netty/netty/commit/b82258b72fdf4c733d9c4a641c6b8725b036485f) Introduce `needReport` for `ResourceLeakDetector`. ([#9910](https://github-redirect.dependabot.com/netty/netty/issues/9910))
- [`76fb4c8`](https://github.com/netty/netty/commit/76fb4c894af15cd1e30495a91074b2d95940e451) use io.netty.leakDetection.targetRecords as replacement for io.netty.leakDete...
- [`2be3d88`](https://github.com/netty/netty/commit/2be3d888e73defb863ee460fc276a8959cb82604) FlushConsolidationHandler may suppress flushes by mistake ([#9931](https://github-redirect.dependabot.com/netty/netty/issues/9931))
- [`06a5173`](https://github.com/netty/netty/commit/06a5173e8d700f5f431557f21f647f2199bb3d52) Utf8FrameValidator must release buffer when validation fails ([#9909](https://github-redirect.dependabot.com/netty/netty/issues/9909))
- Additional commits viewable in [compare view](https://github.com/netty/netty/compare/netty-4.1.34.Final...netty-4.1.45.Final)
</details>
<br />

Updates `netty-handler` from 4.1.34.Final to 4.1.45.Final
<details>
<summary>Commits</summary>

- [`136db86`](https://github.com/netty/netty/commit/136db8680afa73c7491277d6fed1e85e703fa905) [maven-release-plugin] prepare release netty-4.1.45.Final
- [`607bc05`](https://github.com/netty/netty/commit/607bc05a2c1453323b2f8c67cbd4aff0d5b17531) Fix BufferOverflowException during non-Unsafe PooledDirectByteBuf resize ([#9912](https://github-redirect.dependabot.com/netty/netty/issues/9912))
- [`ba140ac`](https://github.com/netty/netty/commit/ba140ac6bcf24fdd90d1231ee397ba5a204c17e8) Fix SimpleChannelPoolTest#testCloseAsync() test flake ([#9943](https://github-redirect.dependabot.com/netty/netty/issues/9943))
- [`f7d3573`](https://github.com/netty/netty/commit/f7d357312fa634431aa4af180691cb12efacd902) Add TLS SNI Extension in HTTP/2 Client request. ([#9937](https://github-redirect.dependabot.com/netty/netty/issues/9937))
- [`ac69c87`](https://github.com/netty/netty/commit/ac69c877f1a9857fd8a97c704c882414e66c4920) Fix SniHandlerTest when jdkCompatibilityMode is false ([#9934](https://github-redirect.dependabot.com/netty/netty/issues/9934))
- [`41c47b4`](https://github.com/netty/netty/commit/41c47b41bf0caa2f0faffec901a374516fbd19f7) Fix event loop hang in SniHandler ([#9933](https://github-redirect.dependabot.com/netty/netty/issues/9933))
- [`b82258b`](https://github.com/netty/netty/commit/b82258b72fdf4c733d9c4a641c6b8725b036485f) Introduce `needReport` for `ResourceLeakDetector`. ([#9910](https://github-redirect.dependabot.com/netty/netty/issues/9910))
- [`76fb4c8`](https://github.com/netty/netty/commit/76fb4c894af15cd1e30495a91074b2d95940e451) use io.netty.leakDetection.targetRecords as replacement for io.netty.leakDete...
- [`2be3d88`](https://github.com/netty/netty/commit/2be3d888e73defb863ee460fc276a8959cb82604) FlushConsolidationHandler may suppress flushes by mistake ([#9931](https://github-redirect.dependabot.com/netty/netty/issues/9931))
- [`06a5173`](https://github.com/netty/netty/commit/06a5173e8d700f5f431557f21f647f2199bb3d52) Utf8FrameValidator must release buffer when validation fails ([#9909](https://github-redirect.dependabot.com/netty/netty/issues/9909))
- Additional commits viewable in [compare view](https://github.com/netty/netty/compare/netty-4.1.34.Final...netty-4.1.45.Final)
</details>
<br />

Updates `netty-transport` from 4.1.34.Final to 4.1.45.Final
<details>
<summary>Commits</summary>

- [`136db86`](https://github.com/netty/netty/commit/136db8680afa73c7491277d6fed1e85e703fa905) [maven-release-plugin] prepare release netty-4.1.45.Final
- [`607bc05`](https://github.com/netty/netty/commit/607bc05a2c1453323b2f8c67cbd4aff0d5b17531) Fix BufferOverflowException during non-Unsafe PooledDirectByteBuf resize ([#9912](https://github-redirect.dependabot.com/netty/netty/issues/9912))
- [`ba140ac`](https://github.com/netty/netty/commit/ba140ac6bcf24fdd90d1231ee397ba5a204c17e8) Fix SimpleChannelPoolTest#testCloseAsync() test flake ([#9943](https://github-redirect.dependabot.com/netty/netty/issues/9943))
- [`f7d3573`](https://github.com/netty/netty/commit/f7d357312fa634431aa4af180691cb12efacd902) Add TLS SNI Extension in HTTP/2 Client request. ([#9937](https://github-redirect.dependabot.com/netty/netty/issues/9937))
- [`ac69c87`](https://github.com/netty/netty/commit/ac69c877f1a9857fd8a97c704c882414e66c4920) Fix SniHandlerTest when jdkCompatibilityMode is false ([#9934](https://github-redirect.dependabot.com/netty/netty/issues/9934))
- [`41c47b4`](https://github.com/netty/netty/commit/41c47b41bf0caa2f0faffec901a374516fbd19f7) Fix event loop hang in SniHandler ([#9933](https://github-redirect.dependabot.com/netty/netty/issues/9933))
- [`b82258b`](https://github.com/netty/netty/commit/b82258b72fdf4c733d9c4a641c6b8725b036485f) Introduce `needReport` for `ResourceLeakDetector`. ([#9910](https://github-redirect.dependabot.com/netty/netty/issues/9910))
- [`76fb4c8`](https://github.com/netty/netty/commit/76fb4c894af15cd1e30495a91074b2d95940e451) use io.netty.leakDetection.targetRecords as replacement for io.netty.leakDete...
- [`2be3d88`](https://github.com/netty/netty/commit/2be3d888e73defb863ee460fc276a8959cb82604) FlushConsolidationHandler may suppress flushes by mistake ([#9931](https://github-redirect.dependabot.com/netty/netty/issues/9931))
- [`06a5173`](https://github.com/netty/netty/commit/06a5173e8d700f5f431557f21f647f2199bb3d52) Utf8FrameValidator must release buffer when validation fails ([#9909](https://github-redirect.dependabot.com/netty/netty/issues/9909))
- Additional commits viewable in [compare view](https://github.com/netty/netty/compare/netty-4.1.34.Final...netty-4.1.45.Final)
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/firebase/firebase-admin-java/network/alerts).

</details>


Patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index fbb1aad..58ecbfa 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -13,7 +13,7 @@
 # limitations under the License.
 name: Continuous Integration
 
-on: push
+on: pull_request
 
 jobs:
   build:
diff --git a/pom.xml b/pom.xml
index af25b87..b71b4e7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,7 +59,7 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
         <skipUTs>${skipTests}</skipUTs>
-        <netty.version>4.1.34.Final</netty.version>
+        <netty.version>4.1.45.Final</netty.version>
     </properties>
 
     <scm>
diff --git a/src/main/java/com/google/firebase/messaging/BatchResponse.java b/src/main/java/com/google/firebase/messaging/BatchResponse.java
index bd5069f..164403b 100644
--- a/src/main/java/com/google/firebase/messaging/BatchResponse.java
+++ b/src/main/java/com/google/firebase/messaging/BatchResponse.java
@@ -16,7 +16,6 @@
 
 package com.google.firebase.messaging;
 
-import com.google.common.collect.ImmutableList;
 import com.google.firebase.internal.NonNull;
 import java.util.List;
 
@@ -25,32 +24,12 @@ import java.util.List;
  * See {@link FirebaseMessaging#sendAll(List)} and {@link
  * FirebaseMessaging#sendMulticast(MulticastMessage)}.
  */
-public final class BatchResponse {
-
-  private final List<SendResponse> responses;
-  private final int successCount;
-
-  BatchResponse(List<SendResponse> responses) {
-    this.responses = ImmutableList.copyOf(responses);
-    int successCount = 0;
-    for (SendResponse response : this.responses) {
-      if (response.isSuccessful()) {
-        successCount++;
-      }
-    }
-    this.successCount = successCount;
-  }
+public interface BatchResponse {
 
   @NonNull
-  public List<SendResponse> getResponses() {
-    return responses;
-  }
+  List<SendResponse> getResponses();
 
-  public int getSuccessCount() {
-    return successCount;
-  }
+  int getSuccessCount();
 
-  public int getFailureCount() {
-    return responses.size() - successCount;
-  }
+  int getFailureCount();
 }
diff --git a/src/main/java/com/google/firebase/messaging/BatchResponseImpl.java b/src/main/java/com/google/firebase/messaging/BatchResponseImpl.java
new file mode 100644
index 0000000..99cf63d
--- /dev/null
+++ b/src/main/java/com/google/firebase/messaging/BatchResponseImpl.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright  2020 Google Inc.
+ *
+ * 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 com.google.firebase.messaging;
+
+import com.google.common.collect.ImmutableList;
+import com.google.firebase.internal.NonNull;
+
+import java.util.List;
+
+/**
+ * Response from an operation that sends FCM messages to multiple recipients.
+ * See {@link FirebaseMessaging#sendAll(List)} and {@link
+ * FirebaseMessaging#sendMulticast(MulticastMessage)}.
+ */
+class BatchResponseImpl implements BatchResponse {
+
+  private final List<SendResponse> responses;
+  private final int successCount;
+
+  BatchResponseImpl(List<SendResponse> responses) {
+    this.responses = ImmutableList.copyOf(responses);
+    int successCount = 0;
+    for (SendResponse response : this.responses) {
+      if (response.isSuccessful()) {
+        successCount++;
+      }
+    }
+    this.successCount = successCount;
+  }
+
+  @NonNull
+  public List<SendResponse> getResponses() {
+    return responses;
+  }
+
+  public int getSuccessCount() {
+    return successCount;
+  }
+
+  public int getFailureCount() {
+    return responses.size() - successCount;
+  }
+
+}
diff --git a/src/main/java/com/google/firebase/messaging/FirebaseMessagingClientImpl.java b/src/main/java/com/google/firebase/messaging/FirebaseMessagingClientImpl.java
index c2659a2..53d5ab0 100644
--- a/src/main/java/com/google/firebase/messaging/FirebaseMessagingClientImpl.java
+++ b/src/main/java/com/google/firebase/messaging/FirebaseMessagingClientImpl.java
@@ -167,7 +167,7 @@ final class FirebaseMessagingClientImpl implements FirebaseMessagingClient {
     MessagingBatchCallback callback = new MessagingBatchCallback();
     BatchRequest batch = newBatchRequest(messages, dryRun, callback);
     batch.execute();
-    return new BatchResponse(callback.getResponses());
+    return new BatchResponseImpl(callback.getResponses());
   }
 
   private BatchRequest newBatchRequest(


Test patch:
diff --git a/src/test/java/com/google/firebase/messaging/BatchResponseTest.java b/src/test/java/com/google/firebase/messaging/BatchResponseTest.java
index cea0010..9c174f5 100644
--- a/src/test/java/com/google/firebase/messaging/BatchResponseTest.java
+++ b/src/test/java/com/google/firebase/messaging/BatchResponseTest.java
@@ -31,7 +31,7 @@ public class BatchResponseTest {
   public void testEmptyResponses() {
     List<SendResponse> responses = new ArrayList<>();
 
-    BatchResponse batchResponse = new BatchResponse(responses);
+    BatchResponse batchResponse = new BatchResponseImpl(responses);
 
     assertEquals(0, batchResponse.getSuccessCount());
     assertEquals(0, batchResponse.getFailureCount());
@@ -47,7 +47,7 @@ public class BatchResponseTest {
             "error-message", null))
     );
 
-    BatchResponse batchResponse = new BatchResponse(responses);
+    BatchResponse batchResponse = new BatchResponseImpl(responses);
 
     assertEquals(2, batchResponse.getSuccessCount());
     assertEquals(1, batchResponse.getFailureCount());
@@ -61,7 +61,7 @@ public class BatchResponseTest {
   public void testResponsesImmutable() {
     List<SendResponse> responses = new ArrayList<>();
     responses.add(SendResponse.fromMessageId("message1"));
-    BatchResponse batchResponse = new BatchResponse(responses);
+    BatchResponse batchResponse = new BatchResponseImpl(responses);
     SendResponse sendResponse = SendResponse.fromMessageId("message2");
 
     try {
@@ -74,6 +74,6 @@ public class BatchResponseTest {
 
   @Test(expected = NullPointerException.class)
   public void testResponsesCannotBeNull() {
-    new BatchResponse(null);
+    new BatchResponseImpl(null);
   }
 }
diff --git a/src/test/java/com/google/firebase/messaging/FirebaseMessagingTest.java b/src/test/java/com/google/firebase/messaging/FirebaseMessagingTest.java
index bebba08..4968231 100644
--- a/src/test/java/com/google/firebase/messaging/FirebaseMessagingTest.java
+++ b/src/test/java/com/google/firebase/messaging/FirebaseMessagingTest.java
@@ -668,7 +668,7 @@ public class FirebaseMessagingTest {
     for (String messageId : messageIds) {
       listBuilder.add(SendResponse.fromMessageId(messageId));
     }
-    return new BatchResponse(listBuilder.build());
+    return new BatchResponseImpl(listBuilder.build());
   }
 
   private static class MockFirebaseMessagingClient implements FirebaseMessagingClient {