2 * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.model.api.stmt;
10 import static org.junit.Assert.assertEquals;
11 import static org.mockito.ArgumentMatchers.any;
12 import static org.mockito.Mockito.doCallRealMethod;
13 import static org.mockito.Mockito.doReturn;
15 import com.google.common.collect.ImmutableList;
16 import org.junit.Before;
17 import org.junit.Test;
18 import org.junit.runner.RunWith;
19 import org.mockito.Mock;
20 import org.mockito.junit.MockitoJUnitRunner;
21 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement1;
23 @RunWith(MockitoJUnitRunner.StrictStubs.class)
24 public class ActionStatementAwareDeclaredStatementTest {
26 public ActionStatementAwareDeclaredStatement<?> stmt;
28 public DeclaredStatement1 stmt1;
30 public ActionStatement stmt2;
33 public void before() {
34 doReturn(ImmutableList.of(stmt1, stmt2)).when(stmt).declaredSubstatements();
35 doCallRealMethod().when(stmt).declaredSubstatements(any());
36 doCallRealMethod().when(stmt).getActions();
40 public void testGetActions() {
41 assertEquals(ImmutableList.of(stmt2), ImmutableList.copyOf(stmt.getActions()));