[NETCONF-1040] OpenApi: Rework unit test infrastructure Created: 25/May/23 Updated: 31/May/23 Resolved: 31/May/23 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | restconf-openapi |
| Affects Version/s: | None |
| Fix Version/s: | 6.0.0 |
| Type: | Task | Priority: | Medium |
| Reporter: | Ivan Hrasko | Assignee: | Oleksandr Zharov |
| Resolution: | Done | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Currently all unit test in restconf-openapi are using common parent AbstractOpenApiTest. This class creates effective model context from all YANG models under yang folder.
|
| Comments |
| Comment by Ivan Hrasko [ 30/May/23 ] |
|
IMO this is over-engineered. We can just remove AbstractOpenApiTest logic which create effective model context and move it to @BeforeClass of each test class as follows: private static EffectiveModelContext context; @BeforeClass public static void beforeClass() { context = YangParserTestUtils.parseYangResourceDirectory("/yang"); when(SCHEMA_SERVICE.getGlobalContext()).thenReturn(context); } Then we do not to do part #2 of this task. |
| Comment by Ivan Hrasko [ 30/May/23 ] |
|
In addition, we can remove AbstractOpenApiTest completelly and make OpenApiTestUtils instead. |