blob: 03479d582d4142ea944f48dd48a610171d98c83f [file] [log] [blame]
nicklesh adlakha90bfa6a2016-04-28 20:38:33 +05301/*
2 * Copyright 2016-present Open Networking Laboratory
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16package org.onosproject.isis.io.util;
17
18import org.easymock.EasyMock;
19import org.junit.After;
20import org.junit.Before;
21import org.junit.Test;
22import org.onosproject.isis.controller.IsisInterface;
23import org.onosproject.isis.controller.IsisLsdb;
24import org.onosproject.isis.controller.IsisPduType;
25import org.onosproject.isis.io.isispacket.IsisHeader;
26
27import static org.hamcrest.CoreMatchers.instanceOf;
28import static org.hamcrest.CoreMatchers.is;
29import static org.junit.Assert.assertThat;
30
31/**
32 * Unit test class for LspGenerator.
33 */
34public class LspGeneratorTest {
35 private LspGenerator generator;
36 private IsisHeader isisHeader;
37 private IsisInterface isisInterface;
38 private IsisLsdb isisLsdb;
39
40 @Before
41 public void setUp() throws Exception {
42 generator = new LspGenerator();
43 isisLsdb = EasyMock.createMock(IsisLsdb.class);
44 isisInterface = EasyMock.createMock(IsisInterface.class);
45 }
46
47 @After
48 public void tearDown() throws Exception {
49 generator = null;
50 }
51
52 /**
53 * Tests getHeader() method.
54 */
55 @Test
56 public void testGetHeader() throws Exception {
57 isisHeader = generator.getHeader(IsisPduType.L1CSNP);
58 assertThat(isisHeader, is(instanceOf(IsisHeader.class)));
59 }
60}