+💯 to what Jake said. Java language asserts are a crutch that enables you to get what you think you want from your tests without getting any of the design feedback which is where I see the main benefit of unit tests and TDD. These asserts are a honey pot that makes it easier for developers to do the easy thing instead of the right thing. Let's not put our hand in that jar!
On Wed, Jul 18, 2018 at 8:18 PM, Jacob Barrett <jbarr...@pivotal.io> wrote: > There is a HUGE difference between Java language assert and an class > called Assert. > > Java language asserts are disabled at runtime by default. They should > only be used for testing assertions when running in a “Test” mode. Since > under such conditions you should have good unit test doing the same it > seems redundant to even have them in the code. > > Under what conditions are you seeing both types of assertions being used > in the main code? > > > On Jul 18, 2018, at 6:52 PM, Galen O'Sullivan <gosulli...@pivotal.io> > wrote: > > > > Hi all, > > > > I'm wondering what the collective's opinion of assertions is. I notice > > there's an org.apache.geode.internal.Assert class, which is used some > > places, and that plain old Java assertions are used in other places. Can > we > > remove one of these and use the other? Should we be including assertions > in > > new or refactored code? > > > > Thanks, > > Galen >