import org.junit.Before
import org.junit.Test
import org.mockito.ArgumentMatchers.anyString
+import org.mockito.Mockito.verify
/**
* Unit test for [DeleteAlbumPage].
addAlbum("album-id", album)
addHttpRequestParameter("album", "album-id")
expectedException.expect(redirectsTo("imageBrowser.html?sone=sone-id"))
- page.handleRequest(freenetRequest, templateContext)
+ try {
+ page.handleRequest(freenetRequest, templateContext)
+ } finally {
+ verify(core).deleteAlbum(album)
+ }
}
@Test
addAlbum("album-id", album)
addHttpRequestParameter("album", "album-id")
expectedException.expect(redirectsTo("imageBrowser.html?album=parent-id"))
- page.handleRequest(freenetRequest, templateContext)
+ try {
+ page.handleRequest(freenetRequest, templateContext)
+ } finally {
+ verify(core).deleteAlbum(album)
+ }
}
}