1 package net.pterodactylus.sone.utils
3 import freenet.support.api.Bucket
4 import net.pterodactylus.sone.test.mock
5 import org.hamcrest.MatcherAssert.assertThat
6 import org.hamcrest.Matchers.equalTo
8 import org.mockito.Mockito.verify
10 class AutoCloseableBucketTest {
12 private val bucket = mock<Bucket>()
13 private val autoCloseableBucket = AutoCloseableBucket(bucket)
16 fun `bucket can be retrieved`() {
17 assertThat(autoCloseableBucket.bucket, equalTo(bucket))
21 fun `bucket will be free’d when close is called`() {
22 autoCloseableBucket.close()