Refactor Swagger unit tests 47/96547/5
authorIvan Hrasko <ivan.hrasko@pantheon.tech>
Wed, 16 Jun 2021 09:52:31 +0000 (11:52 +0200)
committerIvan Hrasko <ivan.hrasko@pantheon.tech>
Thu, 17 Jun 2021 07:30:44 +0000 (09:30 +0200)
commit47bb31c381d6461cce05a2f7b8cd8c08061e3790
treea7960abc4a963652172f969374e7c71d1ff951e6
parentf17385e68a590b369cec43752af7f5b42943908b
Refactor Swagger unit tests

Get rid of incorrect equals call on module revision by
using SchemaContext#findModule methods to find
module according to namespace (and revision).

Because of incorrect equals call the tests
were just passing without any assertions and
were not maintained for long time, some of the
assertions needed to be adapted.

Remove unnecessary code to load EffectiveModelContext
from DocGenTestHelper and instead use YangParserTestUtils
methods directly in tests.

Refactor DocGenTestHelper to be utility class.
Refactor tests code, make tests logic more simple.
Also, introduce tests for ApiDocGeneratorRFC8040.

JIRA: NETCONF-785
Change-Id: I195acbca354cdfe80241430255254436d0dac23f
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
restconf/sal-rest-docgen/src/test/java/org/opendaylight/controller/sal/rest/doc/impl/ApiDocGeneratorDraftO2Test.java [new file with mode: 0644]
restconf/sal-rest-docgen/src/test/java/org/opendaylight/controller/sal/rest/doc/impl/ApiDocGeneratorRFC8040Test.java [new file with mode: 0644]
restconf/sal-rest-docgen/src/test/java/org/opendaylight/controller/sal/rest/doc/impl/ApiDocGeneratorTest.java [deleted file]
restconf/sal-rest-docgen/src/test/java/org/opendaylight/controller/sal/rest/doc/impl/ApiDocServiceImplTest.java
restconf/sal-rest-docgen/src/test/java/org/opendaylight/controller/sal/rest/doc/impl/DocGenTestHelper.java
restconf/sal-rest-docgen/src/test/java/org/opendaylight/controller/sal/rest/doc/impl/MountPointSwaggerTest.java
restconf/sal-rest-docgen/src/test/java/org/opendaylight/controller/sal/rest/doc/impl/SwaggerObjectTest.java