-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These tests are needed to increase test coverage level to required value.
- Loading branch information
Grzegorz Kołakowski
committed
Oct 17, 2024
1 parent
99ffa43
commit b3eef5a
Showing
3 changed files
with
74 additions
and
0 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
38 changes: 38 additions & 0 deletions
38
...onnectors/http/internal/table/lookup/querycreators/QueryFormatAwareConfigurationTest.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,38 @@ | ||
package com.getindata.connectors.http.internal.table.lookup.querycreators; | ||
|
||
import java.util.Collections; | ||
import java.util.Optional; | ||
|
||
import org.apache.flink.configuration.ConfigOption; | ||
import org.apache.flink.configuration.ConfigOptions; | ||
import org.apache.flink.configuration.Configuration; | ||
import org.junit.jupiter.api.Test; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class QueryFormatAwareConfigurationTest { | ||
|
||
private static final ConfigOption<String> configOption = ConfigOptions.key("key") | ||
.stringType() | ||
.noDefaultValue(); | ||
|
||
@Test | ||
public void testWithDot() { | ||
QueryFormatAwareConfiguration queryConfig = new QueryFormatAwareConfiguration( | ||
"prefix.", Configuration.fromMap(Collections.singletonMap("prefix.key", "val")) | ||
); | ||
|
||
Optional<String> optional = queryConfig.getOptional(configOption); | ||
assertThat(optional.get()).isEqualTo("val"); | ||
} | ||
|
||
@Test | ||
public void testWithoutDot() { | ||
QueryFormatAwareConfiguration queryConfig = new QueryFormatAwareConfiguration( | ||
"prefix", Configuration.fromMap(Collections.singletonMap("prefix.key", "val")) | ||
); | ||
|
||
Optional<String> optional = queryConfig.getOptional(configOption); | ||
assertThat(optional.get()).isEqualTo("val"); | ||
} | ||
|
||
} |