Richard North’s Blog

Testcontainers 1.0.0 re­lease

I’ve just re­leased v1.0.0 of Testcontainers, the lit­tle li­brary for us­ing Docker con­tain­ers in JUnit tests. It’s been great to get feed­back and con­tri­bu­tions from oth­ers - and es­pe­cially awe­some to hear kind words about it along the way.

This lat­est re­lease brings some small tweaks and im­prove­ments through­out, as well as one fairly sig­nif­i­cant in­ter­nal change.

If you’re not fa­mil­iar with what Testcontainers is, please check out these posts to find out more:

Shading Jersey and Jackson de­pen­den­cies #

One frus­trat­ingly hard as­pect of re­leas­ing a li­brary that (transitively) de­pends on Jersey and Jackson is the po­ten­tial for ver­sion con­flicts this foists upon users. I’ve ex­pe­ri­enced this my­self us­ing Testcontainers at $WORK, and re­ports from other users have con­firmed my fear that this is some­thing that needs to be fixed.

Stopping short of cre­at­ing a brand new Docker client im­ple­men­ta­tion that did not use Jersey or Jackson, I’ve in­stead used Maven Shade to bun­dle these into the core li­brary. Due to the ex­tent to which Jersey uses Java ServiceLoaders this was ac­tu­ally quite a fid­dly task, re­quir­ing both in­clu­sion and re­lo­cat­ing of rel­e­vant classes and ser­vice loader man­i­fests.

Now that it’s done, it (hopefully) means Jersey and Jackson ver­sion con­flicts are a thing of the past, but if prob­lems per­sist per­haps a more dras­tic course of ac­tion will be in or­der for a fu­ture re­lease

Clearer log­ging around dis­cov­ery of Docker en­vi­ron­ment #

Previously there was lit­tle doc­u­men­ta­tion or use­ful log­ging de­scrib­ing how Testcontainers ac­tu­ally dis­cov­ers the Docker dae­mon. This is now hope­fully clearer and more ob­vi­ous, and won’t push users into hav­ing to read the code to find out 😬.

Feedback? #

I’m re­ally ex­cited to re­lease this next small in­cre­ment, and hope it will serve as a use­ful tool for other de­vel­op­ers!

If you have any is­sues or feed­back, please let me know, ei­ther in a Github is­sue or by email!

← Home