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