Silence warnings about unclosed BasePackPushConnection

Change-Id: If52e8462e6222dd58d1004dd5ac174a27d96d098
This commit is contained in:
Matthias Sohn 2022-11-20 20:32:37 +01:00
parent 9fc9ae6de9
commit f849b8d0d9
1 changed files with 3 additions and 0 deletions

View File

@ -248,6 +248,7 @@ public void testOpenPushUseBitmaps() throws Exception {
try (Transport transport = Transport.open(uri)) {
try (PushConnection pushConnection = transport.openPush()) {
assertTrue(pushConnection instanceof BasePackPushConnection);
@SuppressWarnings("resource")
BasePackPushConnection basePackPushConnection = (BasePackPushConnection) pushConnection;
assertEquals(true, basePackPushConnection.isUseBitmaps());
}
@ -257,6 +258,7 @@ public void testOpenPushUseBitmaps() throws Exception {
transport.setPushUseBitmaps(true);
try (PushConnection pushConnection = transport.openPush()) {
assertTrue(pushConnection instanceof BasePackPushConnection);
@SuppressWarnings("resource")
BasePackPushConnection basePackPushConnection = (BasePackPushConnection) pushConnection;
assertEquals(true, basePackPushConnection.isUseBitmaps());
}
@ -266,6 +268,7 @@ public void testOpenPushUseBitmaps() throws Exception {
transport.setPushUseBitmaps(false);
try (PushConnection pushConnection = transport.openPush()) {
assertTrue(pushConnection instanceof BasePackPushConnection);
@SuppressWarnings("resource")
BasePackPushConnection basePackPushConnection = (BasePackPushConnection) pushConnection;
assertEquals(false, basePackPushConnection.isUseBitmaps());
}