r/java • u/vladmihalceacom • Dec 11 '25
Modern Bytecode Instrumentation with ByteBuddy – Rafael Winterhalter | The Marco Show
https://www.youtube.com/watch?v=AzfhxgkBL9s
40
Upvotes
r/java • u/vladmihalceacom • Dec 11 '25
View all comments
Show parent comment
2
u/repeating_bears Dec 12 '25
Yes, the defaults would be associated with the constructor.
Yes, you're not going to have a default like
String userId = "myTestUser". A default should be something that's sensible if not overriden. If there is no sensible default, a value must be provided explicitly.I'm not sure why you think test code and application code are inherently different? My guess is that you're doing something like this below?
i.e. in application code 'content' and 'tags' must be explicitly provided (so defaults don't make sense). But in test code, it's awkward to provide them for every test when the test only depends on a subset of values, and so it's more convenient to have something that holds test-only defaults?