Modernize sal-rest-docgen tests a bit
[netconf.git] / restconf / sal-rest-docgen / src / test / java / org / opendaylight / controller / sal / rest / doc / impl / AbstractApiDocTest.java
1 /*
2  * Copyright (c) 2022 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.sal.rest.doc.impl;
9
10 import static org.mockito.Mockito.mock;
11 import static org.mockito.Mockito.when;
12
13 import org.junit.BeforeClass;
14 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
15 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
16 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
17
18 public abstract class AbstractApiDocTest {
19     static EffectiveModelContext CONTEXT;
20     static DOMSchemaService SCHEMA_SERVICE;
21
22     @BeforeClass
23     public static void beforeClass() {
24         CONTEXT = YangParserTestUtils.parseYangResourceDirectory("/yang");
25         SCHEMA_SERVICE = mock(DOMSchemaService.class);
26         when(SCHEMA_SERVICE.getGlobalContext()).thenReturn(CONTEXT);
27     }
28 }