|
15 | 15 | */ |
16 | 16 | package org.talend.sdk.component.tools.validator; |
17 | 17 |
|
18 | | -import java.io.Serializable; |
19 | | -import java.util.ArrayList; |
20 | | -import java.util.Set; |
21 | 18 | import static org.junit.jupiter.api.Assertions.assertEquals; |
22 | 19 |
|
| 20 | +import java.io.Serializable; |
| 21 | +import java.util.ArrayList; |
23 | 22 | import java.util.Arrays; |
24 | 23 | import java.util.List; |
| 24 | +import java.util.Set; |
25 | 25 | import java.util.stream.Collectors; |
26 | 26 | import java.util.stream.Stream; |
27 | 27 |
|
|
34 | 34 | import org.talend.sdk.component.api.configuration.action.Updatable; |
35 | 35 | import org.talend.sdk.component.api.configuration.type.DataSet; |
36 | 36 | import org.talend.sdk.component.api.configuration.type.DataStore; |
37 | | -import org.talend.sdk.component.api.configuration.ui.layout.GridLayout; |
38 | 37 | import org.talend.sdk.component.api.meta.ConditionalOutput; |
39 | 38 | import org.talend.sdk.component.api.meta.Documentation; |
40 | 39 | import org.talend.sdk.component.api.processor.ElementListener; |
|
58 | 57 | import org.talend.sdk.component.api.service.schema.DiscoverSchema; |
59 | 58 | import org.talend.sdk.component.api.service.schema.DiscoverSchemaExtended; |
60 | 59 | import org.talend.sdk.component.api.service.update.Update; |
61 | | -import org.talend.sdk.component.tools.ComponentValidator; |
62 | 60 |
|
63 | 61 | class ActionValidatorTest { |
64 | 62 |
|
@@ -128,17 +126,18 @@ void validate() { |
128 | 126 | @Test |
129 | 127 | void validateAvailableOutputFlows() { |
130 | 128 | final ActionValidator validator = new ActionValidator(new FakeHelper()); |
131 | | - AnnotationFinder finder = new AnnotationFinder(new ClassesArchive(AvailableOutputFlowsOK.class, AvailableOutputProcessor.class, ConfigurationAO.class)); |
| 129 | + AnnotationFinder finder = new AnnotationFinder(new ClassesArchive(AvailableOutputFlowsOK.class, |
| 130 | + AvailableOutputProcessor.class, ConfigurationAO.class)); |
132 | 131 | final Stream<String> noerrors = |
133 | | - validator.validate(finder, Arrays.asList(AvailableOutputFlowsOK.class, AvailableOutputProcessor.class, ConfigurationAO.class)); |
| 132 | + validator.validate(finder, Arrays.asList(AvailableOutputFlowsOK.class, AvailableOutputProcessor.class, |
| 133 | + ConfigurationAO.class)); |
134 | 134 | assertEquals(0, noerrors.count()); |
135 | 135 |
|
136 | 136 | finder = new AnnotationFinder(new ClassesArchive(AvailableOutputFlowsKO.class)); |
137 | 137 | final Stream<String> errors = validator.validate(finder, Arrays.asList(AvailableOutputFlowsKO.class)); |
138 | 138 | assertEquals(3, errors.count()); |
139 | 139 | } |
140 | 140 |
|
141 | | - |
142 | 141 | private void assertContains(List<String> errors, String contentPart) { |
143 | 142 | final boolean present = |
144 | 143 | errors.stream().filter((String err) -> err.contains(contentPart)).findFirst().isPresent(); |
@@ -367,20 +366,22 @@ public Set<String> getAvailableOutputs(@Option("configuration") final FakeDataSe |
367 | 366 | } |
368 | 367 | } |
369 | 368 |
|
370 | | - @Processor(name="availableoutputprocessor") |
| 369 | + @Processor(name = "availableoutputprocessor") |
371 | 370 | @ConditionalOutput("outflow-1") |
372 | 371 | static class AvailableOutputProcessor implements Serializable { |
| 372 | + |
373 | 373 | private ConfigurationAO config; |
374 | 374 |
|
375 | 375 | @ElementListener |
376 | 376 | public void process(@Input final Record input, |
377 | | - @Output final OutputEmitter<Record> main, |
378 | | - @Output("second") final OutputEmitter<Record> second) { |
379 | | - //this method here is just used to declare some outputs. |
| 377 | + @Output final OutputEmitter<Record> main, |
| 378 | + @Output("second") final OutputEmitter<Record> second) { |
| 379 | + // this method here is just used to declare some outputs. |
380 | 380 | } |
381 | 381 | } |
382 | 382 |
|
383 | 383 | static class ConfigurationAO implements Serializable { |
| 384 | + |
384 | 385 | @Option |
385 | 386 | @Documentation("Show second output or not.") |
386 | 387 | private boolean showSecond; |
|
0 commit comments