Tales from the jar side: Mockito updates, Goodbye Dame Olivia, and Librarians take down a President
What happens when you cross an angry sheep with an angry cow? You get an animal in a baaaaad moooood. (Sorry)
Welcome, fellow jarheads, to Tales from the jar side, the Kousen IT newsletter, for the week of August 7 - 14, 2022. This week I taught my Managing Your Manager course on the O’Reilly Learning Platform, and my Modern Functional Java course as an NFJS Virtual Workshop.
Regular readers of this newsletter are affectionately known as jarheads, and are far more intelligent, sophisticated, and attractive than the average newsletter reader. If you wish to become a jarhead, please subscribe using this button:
As a reminder, when this message is truncated in email, click on the title at the top to open it in a browser tab formatted properly for both the web and mobile.
Mockito Made Clear
My hope this week was to update my upcoming book, Mockito Made Clear, so that we could release a new beta version. The real goal, of course, is to be finished entirely, but things are not so simple.
I have been working hard on the next beta, but there’s a reason for the current delay, and it’s my fault. The system used by the Pragmatic Programmers to provide reviewer feedback is a shared pdf file. That meant each reviewer could see the comments made by previous reviewers, and add to them if they wanted.
It’s valuable, but I have to admit, it’s hard to read. In some places it feels like they’re ganging up on you, especially if you have difficulties separating yourself from the writing. As I’ve said before, I welcome constructive criticism, but only if it’s in the form of effusive praise and adulation.
The problem is, the comments are almost all correct and helpful, which is incredibly annoying. There’s no doubt the book is much better as a result. Still, it’s been hard to get through them.
I’ve made some pretty extensive changes as a result, many of which I’ll discuss when the new beta comes out, or maybe when the book itself is released. All coming soon.
One of the comments alluded to the fact that Mockito itself should be moving to version 5 very soon. Apparently the most significant change will be to add the inline mock maker to the core of Mockito, meaning if you need to mock constructors, static methods, or final methods or classes, you no longer have to do any additional configuration.
I’ve added a new example for that. I have a class called InMemoryPersonRepository
which includes some final
methods:
To mock the class and methods, I changed the dependency in my Gradle build file from mockito-core
to mockito-inline
(that’s the part I won’t have to do when 5.0 comes out) and wrote this test:
It’s just like any other test, but it wouldn’t be possible without the support for mocking final methods. As always, the code is in the book’s GitHub repository.
If you buy the book in beta form, you of course will receive all the updates, as well as the final version. Be sure to use the coupon code mockito_medium_35 for a 35% discount at the Pragmatic Programmers website.
Miscellaneous
Saying Goodbye to Dame Olivia
This week we lost Olivia Newton-John, age 73, after a recurrent battle with cancer. She was awarded the Order of the British Empire in 1979 by Queen Elizabeth II, so she should technically be referred to as Dame Olivia, but it feels funny to do that here. Most of the articles in the media focused on her role in Grease (1978), where she played Rydell High good girl Sandy Olsson opposite John Travolta’s bad boy Danny Zuko.
Travolta looked too old for high school even at age 23, though he’d been playing a high school kid on Welcome Back, Kotter for years. What I didn’t know was that Olivia was actually 29 at the time and blended in just fine. Stockard Channing as Rizzo stole the show, however.
I fell in love with Olivia in the mid-70’s because, let’s be honest, everybody did. She was the platonic ideal of the sweet girl-next-door and she sang like an angel. She won the first of her four Grammy awards for best country vocalist in 1973 with her single Let Me Be There. That caused some controversy, along the lines of, “just because you have a steel guitar in the accompaniment doesn’t make you country,” but I never cared about that. She then hit Number 1 in 1974 with both I Honestly Love You and Have You Never Been Mellow (an odd turn of phrase if I ever heard one, but she made it work) and never looked back.
Wait, I can’t let that go. Have you never been mellow? Yes, I never have. Wait, what? Have you or haven’t you? Yes, like I said, I never have been, so no. I mean yes.
That reminds me of my favorite double-negative joke:
Professor: English has a double negative, so if you say you’re not not going to do something, you are going to do it. Some languages don’t have that, so you would just be emphasizing you aren’t going to do it. But no language has a double positive, where two yeses make a no.
Student in the back of the room, rolling his eyes: Yeah, yeah.
Olivia followed up Grease with the roller-disco tragedy (at least I think of it as a tragedy) Xanadu (1980). At the time I was both a fan of hers and of ELO, so I was really looking forward to that movie. Let me just say the movie was a disappointment rivaled only by the Star Wars prequels. Olivia was good in it, as was a very old Gene Kelly in his last movie, but the rest was a disaster. The soundtrack, on the other had, did extremely well, and gave her several more hits. I re-listened to it this week, and it’s … fine. A period piece, I suppose. You had to be there, but if you were, get the soundtrack and skip the movie.
Most famous review? “In a word, Xana-don't.”
In Xanadu, Olivia played a Greek Muse.
Disney had a slightly different take on the Muses later:
I always though the muses singing about The Gospel Truth was a bit of ironic fun, but your mileage may vary. Watching the Hercules movie is much easier if you pretend there never existed a myth or legend with that name. The best song in that movie, of course, is I Won’t Say I’m In Love. I’d include it here, but we’re getting pretty far off topic already. Follow the link if you’re interested.
Olivia reacted to the Xanadu nightmare the perfect way, reinventing her entire image and releasing the Physical album late in 1981.
The title track went to Number 1 and stayed there for 10 solid weeks.
According to the article from The Hollywood Reporter linked above, no other song lasted that long at Number 1 the entire decade.
My sister and I were stuck at home during the summer of 1982 when Olivia began her world-wide Physical tour, and the very first show was at the Merriweather Post Pavilion near Baltimore. We lived in York, PA, at the time, which was about a 45 minute drive. We got tickets on the spur of the moment (we were real party animals at the time, but those animals were, at most, koalas). She was fantastic.
One final note. Olivia Newton-John is also the only person I ever sent an actual fan letter to, before or since, and for the zillionth time I’m grateful the Internet didn’t exist back then. I did receive a nice note in return (presumably a form letter, but I didn’t care), along with a catalog from her merch store.
Overdue Materials
The only thing I’m going to say about our current political scandal…
(Ugh, this is Trump world, so I have to be more specific. I mean the one where the FBI searched Mar-a-Lago to retrieve confidential documents that were never supposed to be removed from the White House, secret or not.)
… is that if I were a school librarian, I’d have one sign with the headlines on it and another sign that reminded students there’s a penalty for overdue materials, and just point to each as they checked out books. Shouldn’t need to say another word.
Nailing Al Capone for tax violations is one thing:
but Trump being brought down by some librarians and archivists would be the stuff of legend. I mean, yeah, national security, espionage, and all that, but wow. You seriously couldn’t write a story like that, because no one would believe it.
I thought this was clever:
The corpse thing refers to Ivana being buried on one of Trump’s golf courses, presumably for tax purposes, but I’m not going there.
Oh, this was great, too:
Finally, if you were a foreign spy service during the Trump years and you didn’t have an agent embedded at Mar-a-Lago, what were you even doing?
Another Geeky Tweet
There are a lot of comments I could make, but I’ll just let that go by. Like those neutrinos.
Never Give Up, Never Surrender
Have a good week, everybody, and try not to never be mellow.
As a reminder, you can see all my upcoming training courses on the O’Reilly Learning Platform here and all the upcoming NFJS Virtual Workshops here.
Last week:
Managing Your Manager (APAC time zone), on the O’Reilly Learning Platform
Modern Java: Functional Programming with Streams, Lambdas, and Method References, as an NFJS Virtual Workshop
This week:
Reactive Spring and Spring Boot, on the O’Reilly Learning Platform
Android development, private class