HONEYCOMB-154: update revison of models that changed since 16.09
[honeycomb.git] / lisp / lisp2vpp / src / test / java / io / fd / honeycomb / lisp / translate / read / LispStateCustomizerTest.java
1 package io.fd.honeycomb.lisp.translate.read;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.mockito.Mockito.when;
5
6 import io.fd.honeycomb.translate.read.ReadFailedException;
7 import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
8 import io.fd.honeycomb.vpp.test.read.ReaderCustomizerTest;
9 import org.junit.Before;
10 import org.junit.Test;
11 import org.mockito.Mockito;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.LispState;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.LispStateBuilder;
14 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
15 import io.fd.vpp.jvpp.core.dto.ShowLispStatusReply;
16
17 public class LispStateCustomizerTest extends ReaderCustomizerTest<LispState, LispStateBuilder> {
18
19     private InstanceIdentifier<LispState> identifier;
20
21     public LispStateCustomizerTest() {
22         super(LispState.class, null);
23     }
24
25     @Before
26     public void init() {
27         identifier = InstanceIdentifier.create(LispState.class);
28         final ShowLispStatusReply reply = new ShowLispStatusReply();
29         reply.featureStatus = 1;
30
31         when(api.showLispStatus(Mockito.any())).thenReturn(future(reply));
32     }
33
34     @Test
35     public void testReadCurrentAttributes() throws ReadFailedException {
36
37         LispStateBuilder builder = new LispStateBuilder();
38         getCustomizer().readCurrentAttributes(identifier, builder, ctx);
39
40         assertEquals(true, builder.build().isEnable());
41     }
42
43     @Override
44     protected ReaderCustomizer<LispState, LispStateBuilder> initCustomizer() {
45         return new LispStateCustomizer(api);
46     }
47
48     @Override
49     public void testMerge() throws Exception {
50         //LispState is root node, so there is no way to implement merge(it is also not needed)
51     }
52 }