From: Kai Moritz Date: Mon, 22 Jun 2026 19:51:18 +0000 (+0000) Subject: fix: Sprachbezeichner in Code-Blöcken aller Blog-Artikel korrigiert X-Git-Url: https://juplo.de/gitweb/?a=commitdiff_plain;h=c21ae2f107f831bd9a89eecbe5117b84611f3e5e;p=website fix: Sprachbezeichner in Code-Blöcken aller Blog-Artikel korrigiert Shiki ist case-sensitiv und erkennt Bezeichner wie `Java`, `Bash`, `XPath` nicht — alle fallen auf plaintext zurück. Behoben: - `Java` → `java` in allen 2016er Facebook-App-Posts - `Java` → `xml` in xpath-Artikel (Blöcke enthielten XML, nicht Java) - `Bash` → `log` in problems-deploying (Inhalt ist Log-Output) - `XPath` → `text` (Shiki hat kein XPath/XQuery-Highlighting) - `hosts` → `text` (Shiki kennt kein hosts-Format) - Trailing space nach ` ``` ` in outbox-part-1 entfernt (`java`) - Unlabeled Opening-Fences mit passendem Label versehen: `javascript`, `xml`, `java`, `properties`, `shellsession`, `text` Co-Authored-By: Claude Sonnet 4.6 --- diff --git a/src/content/blog/2012/lange-ladezeiten-durch-openx-werbebanner-verhindern.md b/src/content/blog/2012/lange-ladezeiten-durch-openx-werbebanner-verhindern.md index c93c69de..49404701 100644 --- a/src/content/blog/2012/lange-ladezeiten-durch-openx-werbebanner-verhindern.md +++ b/src/content/blog/2012/lange-ladezeiten-durch-openx-werbebanner-verhindern.md @@ -33,7 +33,7 @@ Das klingt alles einfach und schön - doch wie so oft gilt leider: ## Der Teufel steckt im Detail -``` +```javascript /** Optimierte Methoden für die Werbe-Einblendung via OpenX */ /** see: http://enterprisejquery.com/2010/10/how-good-c-habits-can-encourage-bad-javascript-habits-part-1/ */ diff --git a/src/content/blog/2013/hibernate4-maven-plugin-1-0-1-released.md b/src/content/blog/2013/hibernate4-maven-plugin-1-0-1-released.md index cb35f971..8932d8dd 100644 --- a/src/content/blog/2013/hibernate4-maven-plugin-1-0-1-released.md +++ b/src/content/blog/2013/hibernate4-maven-plugin-1-0-1-released.md @@ -26,7 +26,7 @@ Appart from two bugfixes, this version includes some minor improvements, which m ## Release notes: -``` +```text commit 4b507b15b0122ac180e44b8418db8d9143ae9c3a Author: Kai Moritz Date: Tue Jan 15 23:09:01 2013 +0100 diff --git a/src/content/blog/2013/hibernate4-maven-plugin-1-0-2-release.md b/src/content/blog/2013/hibernate4-maven-plugin-1-0-2-release.md index 4b0846ff..b638630e 100644 --- a/src/content/blog/2013/hibernate4-maven-plugin-1-0-2-release.md +++ b/src/content/blog/2013/hibernate4-maven-plugin-1-0-2-release.md @@ -31,7 +31,7 @@ This release includes: ## Release notes: -``` +```text commit 4edef457d2b747d939a141de24bec5e32abbc0c7 Author: Kai Moritz Date: Fri Aug 2 00:37:40 2013 +0200 diff --git a/src/content/blog/2013/hibernate4-maven-plugin-1-0-3-released.md b/src/content/blog/2013/hibernate4-maven-plugin-1-0-3-released.md index 8afa4b32..c68e8d50 100644 --- a/src/content/blog/2013/hibernate4-maven-plugin-1-0-3-released.md +++ b/src/content/blog/2013/hibernate4-maven-plugin-1-0-3-released.md @@ -39,7 +39,7 @@ Many thanks also to Stephen Johnson and Eduard Szente, who pointed out bugs and ## Release notes: -``` +```text commit adb20bc4da63d4cec663ca68648db0f808e3d181 Author: Kai Moritz Date: Fri Oct 18 01:52:27 2013 +0200 diff --git a/src/content/blog/2014/hibernate4-maven-plugin-1-0-4-released.md b/src/content/blog/2014/hibernate4-maven-plugin-1-0-4-released.md index 1ae14ab1..93c582fd 100644 --- a/src/content/blog/2014/hibernate4-maven-plugin-1-0-4-released.md +++ b/src/content/blog/2014/hibernate4-maven-plugin-1-0-4-released.md @@ -30,7 +30,7 @@ If you have some special small-sized (example) use-cases for the plugin, we woul ## Release notes: -``` +```text commit f3dabc0e6e3676244986b5bbffdb67d427c8383c Author: Kai Moritz Date: Mon Jun 2 10:31:12 2014 +0200 diff --git a/src/content/blog/2014/hibernate4-maven-plugin-1-0-5-released.md b/src/content/blog/2014/hibernate4-maven-plugin-1-0-5-released.md index e1ecca93..99c74574 100644 --- a/src/content/blog/2014/hibernate4-maven-plugin-1-0-5-released.md +++ b/src/content/blog/2014/hibernate4-maven-plugin-1-0-5-released.md @@ -38,7 +38,7 @@ _If you stumble across any problems, please let me know!_ ## Release notes: -``` +```text commit ec30af2068f2d12a9acf65474ca1a4cdc1aa7122 Author: Kai Moritz Date: Tue Nov 11 15:28:12 2014 +0100 diff --git a/src/content/blog/2015/bypassing-the-same-origin-policiy-for-loal-files-during-development.md b/src/content/blog/2015/bypassing-the-same-origin-policiy-for-loal-files-during-development.md index b42d2a84..2804ab4d 100644 --- a/src/content/blog/2015/bypassing-the-same-origin-policiy-for-loal-files-during-development.md +++ b/src/content/blog/2015/bypassing-the-same-origin-policiy-for-loal-files-during-development.md @@ -52,7 +52,7 @@ You can read more about that rule on [MDN](https://developer.mozilla.org/en-US/d I often violate that rule, when developing templates for dynamically rendered pages with [Thymeleaf](http://www.thymeleaf.org/ "Read more about the XML/XHTML/HTML5 template engine Thymeleaf"), or similar techniques. That is, because I like to place the template-files on a subdirectory of the directory, that contains my webapp ( `src/main/webapp` with Maven): -``` +```text + src/main/webapp/ + css/ + img/ diff --git a/src/content/blog/2015/hibernate4-maven-plugin-1-1-0-released.md b/src/content/blog/2015/hibernate4-maven-plugin-1-1-0-released.md index cdfb7cdd..78e3b9a3 100644 --- a/src/content/blog/2015/hibernate4-maven-plugin-1-1-0-released.md +++ b/src/content/blog/2015/hibernate4-maven-plugin-1-1-0-released.md @@ -38,7 +38,7 @@ This release also fixes a bug, that occured on some platforms, if the path to th ## Release notes: -``` +```text commit 94e6b2e93fe107e75c9d20aa1eb3126e78a5ed0a Author: Kai Moritz Date: Sat May 16 14:14:44 2015 +0200 diff --git a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-00.md b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-00.md index dfd47f25..18703813 100644 --- a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-00.md +++ b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-00.md @@ -54,7 +54,7 @@ produces a The code for this.logging.level.de.juplo.yourshouter= part is tagged with `part-00`. Appart from the HTML-templates, the attic for spring-boot and the build-definitions in the `pom.xml` it mainly consists of one file: -```Java +```java @Controller @RequestMapping("/") public class HomeController diff --git a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-01-behind-the-scenes.md b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-01-behind-the-scenes.md index 5f0c0558..bb26f3ae 100644 --- a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-01-behind-the-scenes.md +++ b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-01-behind-the-scenes.md @@ -58,7 +58,7 @@ It also configures, that a request-scoped bean of the type `Connection The following class rebuilds the same configuration explicitly: -```Java +```java @Configuration @EnableSocial public class SocialConfig extends SocialConfigurerAdapter diff --git a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-02-how-spring-social-works.md b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-02-how-spring-social-works.md index daf9bffc..fcab0536 100644 --- a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-02-how-spring-social-works.md +++ b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-02-how-spring-social-works.md @@ -48,7 +48,7 @@ Every time, when it prepares a request for us, Spring Social will ask this sourc Attentive readers might have noticed, that we have configured such a source, when we were [explicitly rebuilding](/develop-a-facebook-app-with-spring-social-part-01-behind-the-scenes/ "Jump back to re-read our explicitly rebuild configuration") the automatic default-configuration of Spring Boot: -```Java +```java public class AnonymousUserIdSource implements UserIdSource { @Override diff --git a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-03-implementing-a-user-id-source.md b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-03-implementing-a-user-id-source.md index a351be8f..797a83df 100644 --- a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-03-implementing-a-user-id-source.md +++ b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-03-implementing-a-user-id-source.md @@ -72,7 +72,7 @@ Mainly, there are two hooks to do that, that means: two interfaces, we have to i The implementation of `ConnectionSignUp` simply uses the ID, that is provided by the social network. Since we are only signing in users from Facebook, these ID's are guaranteed to be unique. -```Java +```java public class ProviderUserIdConnectionSignUp implements ConnectionSignUp { @Override @@ -87,7 +87,7 @@ public class ProviderUserIdConnectionSignUp implements ConnectionSignUp The implementation of `UserIdSource` retrieves the ID, that was stored in the `SecurityContext` (our simple implementation — not to be confused with the class from Spring Security). If no user is stored in the `SecurityContext`, it falls back to the old behavior and returns the fix id `anonymous`. -```Java +```java public class SecurityContextUserIdSource implements UserIdSource { private final static Logger LOG = @@ -116,7 +116,7 @@ public class SecurityContextUserIdSource implements UserIdSource To replace the `AnonymousUserIdSource` by our new implementation, we simply instantiate that instead of the old one in our configuration-class `SocialConfig`: -```Java +```java @Override public UserIdSource getUserIdSource() { @@ -128,7 +128,7 @@ public UserIdSource getUserIdSource() There are several ways to plug in the `ConnectionSignUp`. I decided, to plug it into the instance of `InMemoryUsersConnectionRepository`, that our configuration uses, because this way, the user will be signed up automatically on sign in, if it is not known to the application: -```Java +```java @Override public UsersConnectionRepository getUsersConnectionRepository( ConnectionFactoryLocator connectionFactoryLocator diff --git a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-04-signing-in-users.md b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-04-signing-in-users.md index c21212ad..1ec69159 100644 --- a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-04-signing-in-users.md +++ b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-04-signing-in-users.md @@ -57,7 +57,7 @@ Spring Social provides the interface `SignInAdapter`, that it calls every time, This enables us, to be aware of that event and remember the user for subsequent calls. Our implementation stores the user in our `SecurityContext` to sign him in and creates a cookie to remember him for subsequent calls: -```Java +```java public class UserCookieSignInAdapter implements SignInAdapter { private final static Logger LOG = @@ -94,7 +94,7 @@ If you return a string here, for example `/welcome.html`, the controller would i To enable the Sign-In, we have to plug our `SignInAdapter` into the `ProviderSignInController`: -```Java +```java @Bean public ProviderSignInController signInController( ConnectionFactoryLocator factoryLocator, diff --git a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-05-refactor-the-redirect-logic.md b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-05-refactor-the-redirect-logic.md index 7f4983e1..7ec01014 100644 --- a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-05-refactor-the-redirect-logic.md +++ b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-05-refactor-the-redirect-logic.md @@ -42,7 +42,7 @@ To move all redirect-logic out of `HomeController` and redirect unauthenicated u We refine the method `preHandle`, so that it redirects every request to our sign-in-page, that is not authenticated: -```Java +```java @Override public boolean preHandle( HttpServletRequest request, @@ -95,7 +95,7 @@ You will see, that you will be redirected to our sigin-in-page. As it is now not possible, to call any page except the sigin-up-page, without beeing redirected to our sign-in-page, if you are not authenticated, it is impossible to call any page without being authenticated. Hence, we can (and should!) refine our `UserIdSource`, to throw an exception, if that happens anyway, because it has to be a sign for a bug: -```Java +```java public class SecurityContextUserIdSource implements UserIdSource { diff --git a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-06-sign-in-users-through-the-canvas-page.md b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-06-sign-in-users-through-the-canvas-page.md index 1abe8229..0826bbd6 100644 --- a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-06-sign-in-users-through-the-canvas-page.md +++ b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-06-sign-in-users-through-the-canvas-page.md @@ -88,7 +88,7 @@ For now, you can simply change it to `https://locahost:8443/` in the settings-pa To actually enable the [automatic handling](https://developers.facebook.com/docs/games/gamesonfacebook/login#usingsignedrequest "Read about all the cumbersome steps, that would be necesarry, if you had to handle a signed_requst by yourself") of the `signed_request`, that is, decoding the `signed_request` and sign in the user with the data provided in the `signed_request`, you just have to add the `CanvasSignInController` as a bean in your `SocialConfig`: -```Java +```java @Bean public CanvasSignInController canvasSignInController( ConnectionFactoryLocator connectionFactoryLocator, @@ -116,14 +116,14 @@ Since [we have "secured" all of our pages](/develop-a-facebook-app-with-spring-s To achieve that, we have to refine our [`UserCookieInterceptor`](/develop-a-facebook-app-with-spring-social-part-05-refactor-the-redirect-logic#redirect "Compare the changes to the unchanged method of our UserCookieInterceptor") as follows. First add a pattern for all pages, that are allowed to be accessed unauthenticated: -```Java +```java private final static Pattern PATTERN = Pattern.compile("^/signin|canvas"); ``` Then match the requests against this pattern, instead of the fixed string `/signin`: -```Java +```java if (PATTERN.matcher(request.getServletPath()).find()) return true; diff --git a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-07-what-is-going-on-on-the-wire.md b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-07-what-is-going-on-on-the-wire.md index 8d72fade..a17f4563 100644 --- a/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-07-what-is-going-on-on-the-wire.md +++ b/src/content/blog/2016/develop-a-facebook-app-with-spring-social-part-07-what-is-going-on-on-the-wire.md @@ -54,7 +54,7 @@ Hence, we will switch our configuration to use the `HttpClient` from Apache, bef To siwtch from the default client, that comes with the JDK to Apaches `HttpClient`, you have to configure an instance of `HttpComponentsClientHttpRequestFactory` as `HttpRequestFactory` in your `SocialConfig`: -```Java +```java @Bean public HttpComponentsClientHttpRequestFactory requestFactory(Environment env) { diff --git a/src/content/blog/2016/hibernate-maven-plugin-2-0-0-released.md b/src/content/blog/2016/hibernate-maven-plugin-2-0-0-released.md index d36ebced..ae973cef 100644 --- a/src/content/blog/2016/hibernate-maven-plugin-2-0-0-released.md +++ b/src/content/blog/2016/hibernate-maven-plugin-2-0-0-released.md @@ -68,7 +68,7 @@ _Please let us know, if something wents wrong in your projects and you think it ## Release notes: -``` +```text commit 64b7446c958efc15daf520c1ca929c6b8d3b8af5 Author: Kai Moritz Date: Tue Mar 8 00:25:50 2016 +0100 diff --git a/src/content/blog/2016/problems-deploying-a-spring-boot-app-as-war.md b/src/content/blog/2016/problems-deploying-a-spring-boot-app-as-war.md index d9aeffd3..a968f5d0 100644 --- a/src/content/blog/2016/problems-deploying-a-spring-boot-app-as-war.md +++ b/src/content/blog/2016/problems-deploying-a-spring-boot-app-as-war.md @@ -23,7 +23,7 @@ The WAR was found and deployed by tomcat, but it was never started. Browsing the URL of the app resulted in a 404. And instead of [the fancy Spring-Boot ASCII-art banner](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-spring-application.html "See, what Spring-Boot usually shows, when starting..."), the only matching entry that showed up in my log-file was: -```Bash +```log INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Spring WebApplicationInitializers detected on classpath: [org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration$JerseyWebApplicationInitializer@1fe086c] ``` diff --git a/src/content/blog/2016/xpath-2-0-deep-equal-does-not-match-like-expected-the-problem-with-whitespace.md b/src/content/blog/2016/xpath-2-0-deep-equal-does-not-match-like-expected-the-problem-with-whitespace.md index 1ff22c4f..f8811a6b 100644 --- a/src/content/blog/2016/xpath-2-0-deep-equal-does-not-match-like-expected-the-problem-with-whitespace.md +++ b/src/content/blog/2016/xpath-2-0-deep-equal-does-not-match-like-expected-the-problem-with-whitespace.md @@ -33,13 +33,13 @@ Hence, if they differ only in an attribute, your test will report that they are For example, the XPath-expression -```XPath +```text //child/ref[ancestor::parent/ref=.] ``` will match the ``-node with `@id='bar'`, that is nested insiede the ``-node in this example-XML, what I was not expecting: -```Java +```xml Same Text-Content @@ -52,7 +52,7 @@ will match the ``-node with `@id='bar'`, that is nested insiede the ` diff --git a/src/content/blog/2019/actuator-httptrace-does-not-work-with-spring-boot-2-2.md b/src/content/blog/2019/actuator-httptrace-does-not-work-with-spring-boot-2-2.md index e3b6988c..b238788f 100644 --- a/src/content/blog/2019/actuator-httptrace-does-not-work-with-spring-boot-2-2.md +++ b/src/content/blog/2019/actuator-httptrace-does-not-work-with-spring-boot-2-2.md @@ -34,7 +34,7 @@ To enable it — _prior to 2.2.x_ —, one only had to: 1. Specifiy the dependency for Spring Boot Actuator: - ``` + ```xml org.springframework.boot spring-boot-starter-actuator @@ -67,7 +67,7 @@ _But..._ The simple fix for this problem is, to add a `@Bean` of type `InMemoryHttpTraceRepository` to your **`@Configuration`**-class: -``` +```java @Bean public HttpTraceRepository htttpTraceRepository() { diff --git a/src/content/blog/2020/deduplicating-partitioned-data-with-kafka-streams.md b/src/content/blog/2020/deduplicating-partitioned-data-with-kafka-streams.md index 69fa5a8e..5364a28e 100644 --- a/src/content/blog/2020/deduplicating-partitioned-data-with-kafka-streams.md +++ b/src/content/blog/2020/deduplicating-partitioned-data-with-kafka-streams.md @@ -29,7 +29,7 @@ The order, in which these messages are send, is crucial with respect to the ince Resending the messages in correct order after a failure (or downtime) is no problem. But some of the messages may be send twice (or more often), because the producer does not know exactly, which messages were send successful. -``` +```text Incident A - { id: 1, data: "ab583cc8f8" } Incident B - { id: 2, data: "83ccc8f8f8" } Incident C - { id: 3, data: "115tab5b58" } @@ -98,7 +98,7 @@ That is, our message stream is simply a mapping from names to unique sequence nu In this simplified setup, the implementation effectively boils down to the following method-override: -``` +```java @Override public Iterable transform(String value) { @@ -126,7 +126,7 @@ public Iterable transform(String value) We can use our `ValueTransformer` with **`flatTransformValues()`**, to let Kafka Streams drop the detected duplicate values: -``` +```java streamsBuilder .stream("input") .flatTransformValues( diff --git a/src/content/blog/2020/how-to-instantiatiate-multiple-beans-dinamically-in-spring-boot-based-on-configuration-properties.md b/src/content/blog/2020/how-to-instantiatiate-multiple-beans-dinamically-in-spring-boot-based-on-configuration-properties.md index 68436226..4b146335 100644 --- a/src/content/blog/2020/how-to-instantiatiate-multiple-beans-dinamically-in-spring-boot-based-on-configuration-properties.md +++ b/src/content/blog/2020/how-to-instantiatiate-multiple-beans-dinamically-in-spring-boot-based-on-configuration-properties.md @@ -28,7 +28,7 @@ We will: Additionally Beans can be added programatically very easy with the help of an `ApplicationContextInitializer`: -``` +```java @AllArgsConstructor public class MultipleBeansApplicationContextInitializer implements @@ -76,7 +76,7 @@ _The initializer cannot be instantiated and autowired by Spring!_ If you write an **`EnvironmentPostProcessor`**, you will get access to an instance of `ConfigurableEnvironment`, that contains a complete list of all `PropertySource`'s, that are configured for your Spring-Boot-App. -``` +```java public class MultipleBeansEnvironmentPostProcessor implements EnvironmentPostProcessor @@ -111,7 +111,7 @@ The property names are consistently represented in standard Java-Properties-Nota Finally, you have to [register](https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto-customize-the-environment-or-application-context "Read more on details and/or alternatives of the mechanism") the `EnvironmentPostProcessor` with your Spring-Boot-App. This is done in the **`META-INF/spring.factories`**: -``` +```properties org.springframework.boot.env.EnvironmentPostProcessor=\ de.juplo.demos.multiplebeans.MultipleBeansEnvironmentPostProcessor ``` diff --git a/src/content/blog/2020/how-to-redirect-to-spring-security-oauth2-behind-a-gateway-proxy-hiding-the-app-behind-a-reverse-proxy-gateway.md b/src/content/blog/2020/how-to-redirect-to-spring-security-oauth2-behind-a-gateway-proxy-hiding-the-app-behind-a-reverse-proxy-gateway.md index 3eb6b4a0..c6bb8cda 100644 --- a/src/content/blog/2020/how-to-redirect-to-spring-security-oauth2-behind-a-gateway-proxy-hiding-the-app-behind-a-reverse-proxy-gateway.md +++ b/src/content/blog/2020/how-to-redirect-to-spring-security-oauth2-behind-a-gateway-proxy-hiding-the-app-behind-a-reverse-proxy-gateway.md @@ -72,7 +72,7 @@ _In order to tackle this chicken-egg-problem, we will fool our locally running b On Linux/Unix this can be simply done by editing **`/etc/hosts`**. You just have to add the domain ( `example.com`) at the end of the line that starts with `127.0.0.1`: -```hosts +```text 127.0.0.1 localhost example.com ``` diff --git a/src/content/blog/2020/testing-exception-handling-in-spring-mvc.md b/src/content/blog/2020/testing-exception-handling-in-spring-mvc.md index e59a4da2..f2b1fde5 100644 --- a/src/content/blog/2020/testing-exception-handling-in-spring-mvc.md +++ b/src/content/blog/2020/testing-exception-handling-in-spring-mvc.md @@ -42,7 +42,7 @@ It enables us, to mock away the other layers of the application and concentrate Consider the following controller, that defines a request-handling and an accompanying exception-handler, for an `IllegalArgumentException`, that may by thrown in the business-logic: -``` +```java @Controller public class ExampleController { @@ -75,7 +75,7 @@ The exception-handler resolves the exception as `400: Bad Request` and renders t With the help of `@WebMvcTest`, we can easily mock away the actual implementation of the business-logic and concentrate on the code under test: our specialized exception-handler. -``` +```java @WebMvcTest(ExampleController.class) class ExceptionHandlingApplicationTests { diff --git a/src/content/blog/2021/implementing-the-outbox-pattern-with-kafka-part-0-the-example.md b/src/content/blog/2021/implementing-the-outbox-pattern-with-kafka-part-0-the-example.md index 9dcd7198..8f21abfa 100644 --- a/src/content/blog/2021/implementing-the-outbox-pattern-with-kafka-part-0-the-example.md +++ b/src/content/blog/2021/implementing-the-outbox-pattern-with-kafka-part-0-the-example.md @@ -58,7 +58,7 @@ a (very!) simplistic service takes registration orders for new users. Location: http://localhost:8080/users/peter ``` - Requests to registrate an already existing user will result in a 400 (Bad Request): - ``` + ```shellsession $ echo peter | http :8080/users HTTP/1.1 400 @@ -67,7 +67,7 @@ a (very!) simplistic service takes registration orders for new users. Date: Fri, 05 Feb 2021 14:44:53 GMT ``` - Successfully registrated users can be listed: - ``` + ```shellsession $ http :8080/users HTTP/1.1 200 diff --git a/src/content/blog/2021/implementing-the-outbox-pattern-with-kafka-part-1-the-outbox-table.md b/src/content/blog/2021/implementing-the-outbox-pattern-with-kafka-part-1-the-outbox-table.md index ebc5660e..b0f48488 100644 --- a/src/content/blog/2021/implementing-the-outbox-pattern-with-kafka-part-1-the-outbox-table.md +++ b/src/content/blog/2021/implementing-the-outbox-pattern-with-kafka-part-1-the-outbox-table.md @@ -78,7 +78,7 @@ publisher.publishEvent( The event takes a key ( `username`) and an object as value (an instance of an enum in our case). An `EventListener` receives the events and writes them in the outbox table: -``` +```java @TransactionalEventListener(phase = TransactionPhase.BEFORE_COMMIT) public void onUserEvent(OutboxEvent event) {