Skip to content

OAK-12298: SystemPropertySupplier: allow to signal that property is not present (implies default value)#3003

Open
reschke wants to merge 5 commits into
trunkfrom
OAK-12298
Open

OAK-12298: SystemPropertySupplier: allow to signal that property is not present (implies default value)#3003
reschke wants to merge 5 commits into
trunkfrom
OAK-12298

Conversation

@reschke

@reschke reschke commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

…t present (implies default value)

@reschke reschke self-assigned this Jul 6, 2026
@reschke reschke requested review from mbaedke and rishabhdaim July 6, 2026 11:21
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Commit-Check ❌

Commit rejected by Commit-Check.                                  
                                                                  
  (c).-.(c)    (c).-.(c)    (c).-.(c)    (c).-.(c)    (c).-.(c)  
   / ._. \      / ._. \      / ._. \      / ._. \      / ._. \   
 __\( C )/__  __\( H )/__  __\( E )/__  __\( C )/__  __\( K )/__ 
(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)
   || E ||      || R ||      || R ||      || O ||      || R ||   
 _.' '-' '._  _.' '-' '._  _.' '-' '._  _.' '-' '._  _.' '-' '._ 
(.-./`-´\.-.)(.-./`-´\.-.)(.-./`-´\.-.)(.-./`-´\.-.)(.-./`-´\.-.)
 `-´     `-´  `-´     `-´  `-´     `-´  `-´     `-´  `-´     `-´ 
                                                                  
Commit rejected.                                                  
                                                                  
Type subject_max_length check failed ==> OAK-12298: SystemPropertySupplier: allow to signal that propery is not present (implies default value) - add test for case of property set 
Subject must be at most 120 characters
Suggest: Keep the subject concise (<= configured max) 

--- Commit 4/5:
Type subject_max_length check failed ==> OAK-12298: SystemPropertySupplier: allow to signal that propery is not present (implies default value) - fix value check when no default value 
Subject must be at most 120 characters
Suggest: Keep the subject concise (<= configured max) 

--- Commit 5/5:
Type subject_max_length check failed ==> OAK-12298: SystemPropertySupplier: allow to signal that propery is not present (implies default value) - fix value check when no default and validator rejects 
Subject must be at most 120 characters
Suggest: Keep the subject concise (<= configured max)

…t present (implies default value) - add test for case of property set
@reschke reschke changed the title OAK-12298: SystemPropertySupplier: allow to signal that propery is no… OAK-12298: SystemPropertySupplier: allow to signal that property is not present (implies default value) Jul 6, 2026
reschke added 3 commits July 6, 2026 13:30
…t present (implies default value) - fix tests
…t present (implies default value) - fix value check when no default value
…t present (implies default value) - fix value check when no default and validator rejects
@rishabhdaim

Copy link
Copy Markdown
Contributor

@reschke regarding the commit-check failure due to 120 characters, should we increase it further to 200 ?

}
String newLevel = switch (Objects.requireNonNull(successLogLevel)) {
case "DEBUG", "ERROR", "INFO", "TRACE", "WARN" -> successLogLevel;
default -> throw new IllegalArgumentException("unsupported log level: " + successLogLevel);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #2995, we are removing this exception, so I would avoid changing this method.

Comment on lines +144 to +147
try {
assertNull(SystemPropertySupplier.create("foo", Boolean.class).
usingSystemPropertyReader((n) -> null).get());
} catch (IllegalArgumentException expected) {

@rishabhdaim rishabhdaim Jul 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would re-write this test to use @Test(expected=....) pattern rather than try/catch.
and add Assert.fail() after the test so that it does test that exception is thrown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants