Implement validation for the configuration.

With a first test for the case that the validation does not fail.
Extend unit test for testing invalid config param.