La quietud es la clave de Ryan HolidayNote
“Todos los problemas de la humanidad se deben a que el hombre es incapaz de permanecer callado en una habitación.” —Blaise Pascal, 1654.
“Todos los problemas de la humanidad se deben a que el hombre es incapaz de permanecer callado en una habitación.” —Blaise Pascal, 1654.
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:
1brew install jq
Linux:
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.
1String value = "a Á á É é Í 8 . - ? í Ó ó Ú ú ü / ! ¿";
2
3Stream.of(value.split("")).filter(s -> s.matches("\\p{L}"))
4 .forEach(System.out::printf);
5
6//ÁaáÉeéÍiíÓóoOÚúü
The regular expression uses a Unicode character class escape with a General category property for filter only the letters.