🔥 Remove auto-closeable bucket wrapper
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 7 Apr 2020 08:14:17 +0000 (10:14 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 7 Apr 2020 08:14:17 +0000 (10:14 +0200)
src/main/kotlin/net/pterodactylus/sone/utils/AutoCloseableBucket.kt [deleted file]
src/test/kotlin/net/pterodactylus/sone/utils/AutoCloseableBucketTest.kt [deleted file]

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 (file)
index 58c181f..0000000
+++ /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 (file)
index a705844..0000000
+++ /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<Bucket>()
-       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()
-       }
-
-}