source: apps/routerconsole/java/test/scalatest/net/i2p/router/update/DummyHandlerSpec.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: 971 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 DummyHandlerSpec extends FunSpec with CheckerBehaviors with UpdaterBehaviors with MockitoSugar {
16    def dummyHandler = {
17        val mockCtx = mock[RouterContext]
18        val mockMgr = mock[ConsoleUpdateManager]
19        val dh = new DummyHandler(mockCtx, mockMgr)
20        dh
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("A DummyHandler") {
36        it should behave like checker(dummyHandler)
37
38        it should behave like updater(dummyHandler, validTypes, validMethods)
39    }
40}
Note: See TracBrowser for help on using the repository browser.