source: apps/routerconsole/java/test/scalatest/net/i2p/router/update/UpdateHandlerSpec.scala @ 7dae4eb

Last change on this file since 7dae4eb was 7dae4eb, checked in by str4d <str4d@…>, 3 years ago

ScalaTest?: Fix deprecation warnings

  • Property mode set to 100644
File size: 902 bytes
Line 
1package net.i2p.router.update
2
3import org.scalatest.FunSpec
4import org.scalatest.mockito.MockitoSugar
5
6import java.util.ArrayList
7
8import net.i2p.router.RouterContext
9import net.i2p.update.UpdateMethod
10import net.i2p.update.UpdateType
11
12/**
13 * @author str4d
14 */
15class UpdateHandlerSpec extends FunSpec with UpdaterBehaviors with MockitoSugar {
16    def updateHandler = {
17        val mockCtx = mock[RouterContext]
18        val mockMgr = mock[ConsoleUpdateManager]
19        val uh = new UpdateHandler(mockCtx, mockMgr)
20        uh
21    }
22
23    def validTypes = {
24        val vt = new ArrayList[UpdateType]
25        vt.add(UpdateType.ROUTER_UNSIGNED)
26        vt
27    }
28
29    def validMethods = {
30        val vm = new ArrayList[UpdateMethod]
31        vm.add(UpdateMethod.HTTP)
32        vm
33    }
34
35    describe("An UpdateHandler") {
36        it should behave like updater(updateHandler, validTypes, validMethods)
37    }
38}
Note: See TracBrowser for help on using the repository browser.