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.
17 package io.fd.honeycomb.v3po.translate.v3po.vppstate;
19 import static org.mockito.Mockito.mock;
20 import static org.mockito.Mockito.verify;
22 import io.fd.honeycomb.v3po.translate.spi.read.RootReaderCustomizer;
23 import io.fd.honeycomb.v3po.translate.v3po.test.ListReaderCustomizerTest;
24 import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext;
25 import java.util.Collections;
26 import java.util.List;
27 import org.junit.Test;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.BridgeDomainsBuilder;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.BridgeDomain;
30 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.BridgeDomainBuilder;
31 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.BridgeDomainKey;
33 public class BridgeDomainCustomizerTest
34 extends ListReaderCustomizerTest<BridgeDomain, BridgeDomainKey, BridgeDomainBuilder> {
36 private NamingContext bdContext;
37 private NamingContext interfacesContext;
39 public BridgeDomainCustomizerTest() {
40 super(BridgeDomain.class);
44 public void setUpBefore() {
45 bdContext = new NamingContext("generatedBdName", "bd-test-instance");
46 interfacesContext = new NamingContext("generatedIfaceName", "ifc-test-instance");
50 public void testMerge() throws Exception {
51 final BridgeDomainsBuilder builder = mock(BridgeDomainsBuilder.class);
52 final List<BridgeDomain> value = Collections.emptyList();
53 getCustomizer().merge(builder, value);
54 verify(builder).setBridgeDomain(value);
58 protected RootReaderCustomizer<BridgeDomain, BridgeDomainBuilder> initCustomizer() {
59 return new BridgeDomainCustomizer(api, bdContext);