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