2 * Copyright (c) 2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package io.fd.honeycomb.v3po.translate.v3po.vppstate;
18 import static org.mockito.Mockito.mock;
19 import static org.mockito.Mockito.verify;
21 import io.fd.honeycomb.v3po.translate.spi.read.RootReaderCustomizer;
22 import io.fd.honeycomb.v3po.translate.v3po.test.ListReaderCustomizerTest;
23 import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext;
24 import java.util.Collections;
25 import java.util.List;
26 import org.junit.Test;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.BridgeDomainsBuilder;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.BridgeDomain;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.BridgeDomainBuilder;
30 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.BridgeDomainKey;
32 public class BridgeDomainCustomizerTest extends ListReaderCustomizerTest<BridgeDomain, BridgeDomainKey, BridgeDomainBuilder> {
34 private NamingContext bdContext;
35 private NamingContext interfacesContext;
37 public BridgeDomainCustomizerTest() {
38 super(BridgeDomain.class);
42 public void setUpBefore() {
43 bdContext = new NamingContext("generatedBdName");
44 interfacesContext = new NamingContext("generatedIfaceName");
48 public void testMerge() throws Exception {
49 final BridgeDomainsBuilder builder = mock(BridgeDomainsBuilder.class);
50 final List<BridgeDomain> value = Collections.emptyList();
51 getCustomizer().merge(builder, value);
52 verify(builder).setBridgeDomain(value);
56 protected RootReaderCustomizer<BridgeDomain, BridgeDomainBuilder> initCustomizer() {
57 return new BridgeDomainCustomizer(api, bdContext, interfacesContext);