From: David ‘Bombe’ Roden Date: Tue, 7 Apr 2020 08:14:17 +0000 (+0200) Subject: 🔥 Remove auto-closeable bucket wrapper X-Git-Tag: v82^2~37 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=fbdfcedba2d34ee9a214dd6bb70cc10ed129cbfb;p=Sone.git 🔥 Remove auto-closeable bucket wrapper --- diff --git a/src/main/kotlin/net/pterodactylus/sone/utils/AutoCloseableBucket.kt b/src/main/kotlin/net/pterodactylus/sone/utils/AutoCloseableBucket.kt deleted file mode 100644 index 58c181f..0000000 --- a/src/main/kotlin/net/pterodactylus/sone/utils/AutoCloseableBucket.kt +++ /dev/null @@ -1,11 +0,0 @@ -package net.pterodactylus.sone.utils - -import freenet.support.api.Bucket - -class AutoCloseableBucket(val bucket: Bucket) : AutoCloseable { - - override fun close() { - bucket.free() - } - -} diff --git a/src/test/kotlin/net/pterodactylus/sone/utils/AutoCloseableBucketTest.kt b/src/test/kotlin/net/pterodactylus/sone/utils/AutoCloseableBucketTest.kt deleted file mode 100644 index a705844..0000000 --- a/src/test/kotlin/net/pterodactylus/sone/utils/AutoCloseableBucketTest.kt +++ /dev/null @@ -1,26 +0,0 @@ -package net.pterodactylus.sone.utils - -import freenet.support.api.Bucket -import net.pterodactylus.sone.test.mock -import org.hamcrest.MatcherAssert.assertThat -import org.hamcrest.Matchers.equalTo -import org.junit.Test -import org.mockito.Mockito.verify - -class AutoCloseableBucketTest { - - private val bucket = mock() - private val autoCloseableBucket = AutoCloseableBucket(bucket) - - @Test - fun `bucket can be retrieved`() { - assertThat(autoCloseableBucket.bucket, equalTo(bucket)) - } - - @Test - fun `bucket will be free’d when close is called`() { - autoCloseableBucket.close() - verify(bucket).free() - } - -}