-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: expand empty check on member types (#657)
- Loading branch information
Showing
3 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...anderen/informatievlaanderen/ldes/ldio/config/LdioVersionObjectCreatorAutoConfigTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package be.vlaanderen.informatievlaanderen.ldes.ldio.config; | ||
|
||
import be.vlaanderen.informatievlaanderen.ldes.ldio.configurator.LdioConfigurator; | ||
import be.vlaanderen.informatievlaanderen.ldes.ldio.exception.ConfigPropertyMissingException; | ||
import be.vlaanderen.informatievlaanderen.ldes.ldio.valueobjects.ComponentProperties; | ||
import org.junit.jupiter.api.extension.ExtensionContext; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.Arguments; | ||
import org.junit.jupiter.params.provider.ArgumentsProvider; | ||
import org.junit.jupiter.params.provider.ArgumentsSource; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.stream.Stream; | ||
|
||
import static be.vlaanderen.informatievlaanderen.ldes.ldio.config.LdioVersionObjectCreatorAutoConfig.LdioVersionObjectCreatorTransformerConfigurator.MEMBER_TYPE; | ||
import static org.junit.jupiter.api.Assertions.assertThrows; | ||
|
||
class LdioVersionObjectCreatorAutoConfigTest { | ||
private final LdioConfigurator configurator = new LdioVersionObjectCreatorAutoConfig().ldioConfigurator(); | ||
@ParameterizedTest | ||
@ArgumentsSource(configProvider.class) | ||
void when_NoMemberTypes_Then_exceptionIsThrown(Map<String, String> config) { | ||
ComponentProperties componentProperties = new ComponentProperties("pipelineName", "cName", config); | ||
|
||
assertThrows(ConfigPropertyMissingException.class,() -> configurator.configure(componentProperties)) ; | ||
} | ||
|
||
static class configProvider implements ArgumentsProvider { | ||
@Override | ||
public Stream<Arguments> provideArguments(ExtensionContext extensionContext) { | ||
Map<String, String> empty = new HashMap<>(); | ||
empty.put(MEMBER_TYPE, ""); | ||
return Stream.of( | ||
Arguments.of(new HashMap<String, String>()), | ||
Arguments.of(empty) | ||
); | ||
} | ||
} | ||
} |