justinmclean opened a new issue, #8341:
URL: https://github.com/apache/gravitino/issues/8341
### What would you like to be improved?
Currently,
common/src/main/java/org/apache/gravitino/config/ConfigBuilder.java doesn't
trim config values.
Here's a test to help:
```
@Test
public void testTrimmedValues() {
Map<String, String> props = new HashMap<>();
props.put("int.key", " 1 ");
ConfigEntry<Integer> intEntry = new ConfigBuilder("int.key").intConf();
Assertions.assertEquals(1, intEntry.readFrom(props));
props.put("long.key", " 2 ");
ConfigEntry<Long> longEntry = new ConfigBuilder("long.key").longConf();
Assertions.assertEquals(2L, longEntry.readFrom(props));
props.put("double.key", " 3.5 ");
ConfigEntry<Double> doubleEntry = new
ConfigBuilder("double.key").doubleConf();
Assertions.assertEquals(3.5d, doubleEntry.readFrom(props));
props.put("boolean.key", " true ");
ConfigEntry<Boolean> boolEntry = new
ConfigBuilder("boolean.key").booleanConf();
Assertions.assertTrue(boolEntry.readFrom(props));
}
```
### How should we improve?
Trim non-string values
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]