-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RegularExpresionTestUtil for testing regexes #1041
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good addition. We should add at least cursory test coverage now to ensure that future regressions that are accidentally introduced will get caught prior to downstream integration.
src/test/java/emissary/test/util/RegularExpressionTestUtil.java
Outdated
Show resolved
Hide resolved
src/test/java/emissary/test/util/RegularExpressionTestUtil.java
Outdated
Show resolved
Hide resolved
Co-authored-by: drivenflywheel <[email protected]>
Co-authored-by: drivenflywheel <[email protected]>
This diff looks to have gone a bit wonky. Lots of out-of-scope files now showing up as changed |
should be good now. Just one file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#14 67.84 /opt/emissary/src/test/java/emissary/test/util/RegularExpressionTestUtil.java:[19,7] [PrivateConstructorForUtilityClass] Classes which are not intended to be instantiated should be made non-instantiable with a private constructor. This includes utility classes (classes with only static members), and the main class.
#14 67.84 (see https://errorprone.info/bugpattern/PrivateConstructorForUtilityClass)
#14 67.84 Did you mean 'public final class RegularExpressionTestUtil {'?
#14 67.84 [WARNING] /opt/emissary/src/test/java/emissary/test/util/RegularExpressionTestUtil.java:[20,28] [NonFinalStaticField] Static fields should almost always be final.
#14 67.84 (see https://errorprone.info/bugpattern/NonFinalStaticField)
There are multiple places we're doing something similar to test regex, and plenty of places we need to, but are not yet. It would be nice to clean it all up and use one utility class. Needed for another effort.