Debian Codegraph @

owner-java8/src/test/java/org/aeonbits/owner/java8/Java8Test.java

raw symbols SCIP
1 /*
2 * Copyright (c) 2012-2015, Luigi R. Viggiano
3 * All rights reserved.
4 *
5 * This software is distributable under the BSD license.
6 * See the terms of the BSD license in the documentation provided with this software.
7 */
8 package org.aeonbits.owner.java8;
9
10 import org.aeonbits.owner.ConfigFactory;
11 import org.junit.Before;
12 import org.junit.Test;
13
14 import static java.lang.Integer.valueOf;
15 import static org.junit.Assert.assertEquals;
16
17 /**
18 * @author Luigi R. Viggiano
19 */
20 public class Java8Test {
21
22 private ConfigWithJava8Features cfg;
23
24 @Before
25 public void before() {
26 cfg = ConfigFactory.create(ConfigWithJava8Features.class);
27 }
28
29 @Test
30 public void defaultMethodsShouldWork() {
31 assertEquals(valueOf(8), cfg.sum(3, 5));
32 }
33
34
35 @Test
36 public void staticMethodsShouldWork() {
37 assertEquals(3, ConfigWithJava8Features.min(3, 10));
38 }
39
40 @Test
41 public void regularInterfaceMethodsShouldWork() {
42 assertEquals(100, cfg.oneHundred());
43 }
44 }