While going across many modules from spring boot repositories, I could find assertions in /src/main/ like here as below in file,
public OAuth2AccessToken(TokenType tokenType, String tokenValue, Instant issuedAt, Instant expiresAt,
Set<String> scopes) {
super(tokenValue, issuedAt, expiresAt);
Assert.notNull(tokenType, "tokenType cannot be null");
this.tokenType = tokenType;
this.scopes = Collections.unmodifiableSet((scopes != null) ? scopes : Collections.emptySet());
}
Isn't it should be using exceptions to be thrown instead for all such validations under /src/main/.
As far as I've read, assertions are meant to be used with test cases under /src/test/.