Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
@Component
@RequiredArgsConstructor
public class Example {
 
private ClRuntimeParameterGroup parameters;
....
 
public void method() {
    ..... 
    long heartBeatMs = parameters.getHeartBeatMs();
    .....
}


The below code shows an example of validation of the POJO ClRuntimeParameterGroup which contains the values mapped from properties file.

Code Block
languagejava
    private ValidatorFactory validatorFactory = Validation.buildDefaultValidatorFactory();

    @Test
    void testParameters_NullTopicParameterGroup() {
        final ClRuntimeParameterGroup parameters = CommonTestData.geParameterGroup();
        parameters.setTopicParameterGroup(null);
        assertThat(validatorFactory.getValidator().validate(parameters)).isNotEmpty();
    }



Note

This page is Work in Progress

...