NIFI-10153 Refactor DocGeneratorTest and remove binary test files#6146
NIFI-10153 Refactor DocGeneratorTest and remove binary test files#6146exceptionfactory wants to merge 1 commit intoapache:mainfrom
Conversation
bejancsaba
left a comment
There was a problem hiding this comment.
+1 from me, thanks for the cleanup! I had two minor comments but that shouldn't block merging, will leave it up to you
| doReturn(PROCESSOR_CLASS).when(extensionManager).getClass(eq(definition)); | ||
|
|
||
| final Processor processor = new ProcessorWithLogger(); | ||
| when(extensionManager.getTempComponent(eq(PROCESSOR_CLASS.getName()), eq(bundleCoordinate))).thenReturn(processor); |
There was a problem hiding this comment.
As you don't really need the processor you could just simply do Mockito.mock(ProcessorWithLogger.class) at return.
There was a problem hiding this comment.
Actually the documentation generation uses the instantiated component during HTML generation.
| assertFalse(files.isEmpty()); | ||
|
|
||
| final File file = files.iterator().next(); | ||
| final byte[] bytes = Files.readAllBytes(file.toPath()); |
There was a problem hiding this comment.
Can you use Files.readString? It is basically the same you can save a few lines :)
There was a problem hiding this comment.
It looks like Files.readString was introduced in Java 11, so this seems to be the best approach for now.
|
Thanks for the review @bejancsaba! |
kevdoran
left a comment
There was a problem hiding this comment.
+1 from me. Thanks @exceptionfactory - if you can address the merge conflicts, I'll be happy to merge this
4d74263 to
c012b0d
Compare
|
Thanks @kevdoran, rebased. |
Summary
NIFI-10153 Refactors the
DocGeneratorTestinnifi-documentationand to eliminate the need for binary NAR files in the project repository. The refactored implementation mocks theExtensionManagerand returns component and bundle information to support HTML documentation generation.Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation