Form Param Request Matching with WireMock
The following is an example of how to use the withFormParam
method to customize the response of a stub based on the value of a from parameter.
Hi there.
This is my personal site, I created it to fulfill the need of having my own place to drop notes, thoughts, pictures, or whatever I want to share on the internet. I like the concept of Digital Gardening and that’s the intention I have with this site, so you probably are going to find publications that may not have sense at all, but they do for me. I also believe in the idea of learning in public, so you are going to find a lot of “Today I Learned” (TIL) kind of notes which are short publications containing small fragments of information about something new I’ve learned.
I work as a software engineer and I have been doing so for about 10 years now, mainly focused on the backend, but I have done some frontend stuff too. I also have other interests that I explore in my free time such as reading books, writing, learning English, and exercising.
Feel free to look around and I hope you find something useful.
The following is an example of how to use the withFormParam
method to customize the response of a stub based on the value of a from parameter.
In some test scenarios, a Spring Bean can become corrupted, causing other test scenarios to fail. To prevent this, we can annotate a test class or test method with @DirtiesContext
, which tells the Spring Framework that the ApplicationContext is dirty, forcing the rebuilding of the Spring container and creating a new bean instances.
A JavaBean is a standard Java class with getter/setter methods, a no-arg constructor, and is serializable. And a Spring Bean is any Java object managed by Spring and can be automatically injected into other components. The Spring Dependency injection allows Spring to manage and inject beans where needed.
I’ve been learning more about testing spring boot application. I had tested spring boot applications before, but I had only used some basic features. Now, I would like to go deeper to explore what interesting things can be done with it.
The Mockito framework has the ArgumentCaptor class that can be use to validate the arguments passed to a mocked method.
Install the jq
package:
macOS:
brew install jq
Linux:
sudo apt-get install jq
How to use it:
Julia Evans suggests keeping a document with all the work we’ve done —she calls it a Brag Document— to share with our managers, making their job easier during performance evaluations.
This StackOverflow answer explains the different between List.of
and Arrays.asList
.
String value = "a Á á É é Í 8 . - ? í Ó ó Ú ú ü / ! ¿";
Stream.of(value.split("")).filter(s -> s.matches("\\p{L}"))
.forEach(System.out::printf);
//ÁaáÉeéÍiíÓóoOÚúü
The regular expression uses a Unicode character class escape with a General category property for filter only the letters.
[10:59] Where Jeremy talks about the disadvantages of using platforms such as FaceBook, Instagram, or Twitter.
On the Big Web, you never own your own home. You must rent your home from Megacorps. Most often, you don’t have to pay for your home using money. You pay for it by forfeiting your privacy, freedom of speech, and your other human rights. Collectively, we pay for it by forfeiting a democratic future.1
Surfing the web is about going on an adventure, it’s about clicking links and seeing where they go. You won’t find Web Revival sites on typical search engines, you won’t find them on social media sites and no algorithm will pick them out for you. To surf the Web Revival, you start on one site, you find links and you follow the trail; be brave, explore, keep going, keep going!1