Tag java
Using @Mock
as a Method Parameter with Mockito (2 mins read).
Using @Mock
on method parameters to reduce manual mock setups with Mockito.
Keeping Track of Certificate Expiry with a JWKS to iCalendar Converter (4 mins read).
Creating an iCalendar feed for certificate expiry details, given a URI for a JSON Web Key Set.
How to Run Java on the Command-Line to Attach a Debugger (1 mins read).
How to run java
on the command-line, and make it possible to attach a debugger.
Extract a Public Cert from a Java Keystore/Truststore (1 mins read).
How to export the public certificate from a Java keystore.
Evicting Spring Cache on a Schedule (1 mins read).
How to evict Spring Cache's @Cacheable
data on a schedule.
Found this out today, via a colleague, as a good way for your Java library to expose information about the API stability / intent behind classes.
How to avoid HttpMessageNotReadableException
when using ContentCachingRequestWrapper
with Java Servlet Filters (1 mins read).
How to avoid receiving Required request body is missing
errors when using a ContentCachingRequestWrapper
.
Reading a Servlet/Spring Request Body Multiple Times (2 mins read).
How to read the request body more than once using Java Servlet Filters.
Disabling @Valid
Annotation in a Spring Integration Test (1 mins read).
How to disable @Valid
validation in Spring Integration Tests.
#Java friends testing using #RestAssured, you may enjoy my article https://www.jvt.me/posts/2020/05/18/rest-assured-curl/ which can help you convert its logs to curl
requests, for cases you need to do some manual testing, too
Running Spotless Automagically with Gradle (2 mins read).
How to set Gradle configuration globally to always run spotlessApply
in your projects.
Tomcat May Log Cookies Out-of-the-Box (3 mins read).
Warning you about cookies being logged out-of-the-box, and how to resolve it.
Providing Custom Serialization for Map
Keys in Jackson (1 mins read).
How to configure Jackson to use a custom method to serialise keys for a Map
.
Extract a Private Key from a Java Keystore (1 mins read).
How to export an asymmetric PrivateKeyEntry
entry from a Java keystore.
How to unzip/decompress a Java JAR file (1 mins read).
How we can use the unzip
command to decompress JAR files.
Generating HMAC Signatures on the Command Line with OpenSSL (1 mins read).
How to generate HMAC signatures for a given string, using openssl
.
Meant to share this a couple of weeks ago - this is really great, and was very timely after a presentation from a colleague about #Kotlin, and the fact that the data
class that Kotlin has is very cool. Still a while away from my own Java code but interesting nonetheless!
Generate Plain Old Java Objects (POJOs) from XML Schema Definitions with xjc
(4 mins read).
How to generate POJOs really quickly and easily, with no manual work, using the xjc
command.
This is very cool. I've been thinking about containerising my personal APIs for this site, and I guess this would remove a lot of the work! Looking forward to playing with this once it's released.
This is very interesting to hear just days after a colleague gives a compelling introduction to Kotlin of which one key selling point (to me at least) is reducing boilerplate for Plain Old Java Objects (POJOs) that are effectively data-only objects.
That being said, it's still a way off compared to Java 8, and could be nice to try out Kotlin a bit more.
Performing Mutual TLS Authentication with Rest Assured (via Apache HTTP Client) (3 mins read).
How to configure Rest Assured to perform Mutual TLS authentication against an API.
2018 in Review (25 mins read).
Looking back at 2018 as a whole - both the positives and negatives, and looking forward to 2019.
Gotcha: Running both JUnit4 and JUnit5 Together with Gradle (1 mins read).
How to make sure your JUnit4 and JUnit5 Gradle tests work within the same project.
Gotcha: Running both JUnit4 and JUnit5 Together with Maven (1 mins read).
How to make sure your JUnit4 and JUnit5 Maven tests work within the same project.
A subtle and not so fun source of bugs if you're affected - worth investigating!
Setting Your Maven Project Versions (1 mins read).
How to set the versions of all Maven pom.xml
s within a Maven project.
Listing the Contents of a Java Truststore (3 mins read).
How to extract a list of trusted certificates from a Java Trust store.
Testing Your SLF4J Logs (2 mins read).
Looking at how we would unit test our SLF4J logs to gain confidence they work, and to catch regressions in the future.
Extracting Request Parameters Dynamically for a application/x-www-form-urlencoded
Request in Spring (1 mins read).
How to access all key-value pairs of parameters sent in a application/x-www-form-urlencoded
request.
Extracting Request Parameters Dynamically for a multipart/form-data
Request (2 mins read).
How to access all key-value pairs of parameters sent in a multipart/form-data
request.
Extract a Secret Key from a Java Keystore (2 mins read).
How to export a symmetric SecretKey
entry from a Java keystore.
Verify if a field in a JSON response is not set with Rest Assured (1 mins read).
How to verify whether a field is not present in a JSON Rest Assured Response
.
Pretty Print JSON with Java (1 mins read).
How to pretty print a JSON object using Java and Jackson.
Gotcha: URL Encoding for consecutive double slashes issue with Rest Assured (2 mins read).
How to workaround consecutive double slashes being URL encoded (as %2F
s) in Rest Assured.
Prettier HTML Reports for Cucumber-JVM (2 mins read).
How to generate prettier HTML reports for Cucumber with cucumber-reporting
and cucumber-reporting-plugin
, with and without Jenkins.
Creating a versionable, self-contained (fat-/uber-) JAR for Gatling tests (17 mins read).
Why you'd want a fat JAR for your Gatling tests and how you'd achieve it.
Creating a versionable, self-contained (fat-/uber-) JAR for Cucumber tests (11 mins read).
Why you'd want a fat JAR and how you'd achieve it.
You're currently viewing page 4 of 4, of 199 posts.