Skip to content

Instantly share code, notes, and snippets.

@gantoin
gantoin / transactional-integration.md
Created November 2, 2024 21:19
Why You Should Avoid Using @transactional in Integration Tests

When working with integration tests in a Spring-based application, it can be tempting to annotate your tests with @Transactional for the sake of convenience. After all, the idea of automatically rolling back changes after each test sounds practical. However, this approach can lead to misleading test results and ultimately harm the reliability of your integration tests. In this article, we'll explore three key reasons why you should avoid annotating integration tests with @Transactional.

1. Integration Testing Means Real-World Scenarios

Integration tests are designed to validate that different parts of your application work correctly when combined. This means simulating an environment that is as close as possible to the real conditions under which your application runs. In production, your application typically doesn't run inside a global transaction that rolls back at the end of each execution. Annotating your integration tests with @Transactional imposes an unrealistic execution context.

When `@

@gantoin
gantoin / kafka-schema-registry.md
Last active February 5, 2023 08:32
๐ŸšŒ Make your Kafka bus more robust with Apache Avro & Confluent Schema Registry

๐ŸšŒ Make your Kafka bus more robust with Apache Avro & Confluent Schema Registry

tags: kafka, avro, blog

In this article, you will learn how to use Apache Avro and Confluent Schema Registry to make your Kafka bus more robust.

Introduction

Apache Kafka is a distributed streaming platform. It is used to publish and subscribe to streams of records, similar to a message queue or enterprise messaging system. Kafka is often used as a data bus to connect different systems and applications. It is a very powerful tool, but it is not without its challenges. One of the most common challenges is the lack of data validation.

@gantoin
gantoin / landoop-fast-data-dev-m1.md
Last active January 26, 2023 11:34
๐Ÿณ How to run 'landoop/fast-data-dev' on Mac M1?

๐Ÿณ How to run 'landoop/fast-data-dev' on Mac M1?

tags: blog, docker, arm

Hey guys!

I was following a lecture about Kafka Schema Registry when I suddenly had to run Landoop and a bunch of tools with Docker on my Mac.

I met this error after running this Dockerfile:

@gantoin
gantoin / chatgpt-api-in-java.md
Last active September 25, 2025 03:13
๐Ÿค– How to use ChatGPT API in your Java application?

๐Ÿค– How to use ChatGPT API in your Java application?

tags: chatgpt, java, api

Hi guys ๐Ÿ‘‹ I'm sure you enjoy using chat GPT to produce, optimise, or translate code from any programming language to Java.

Today I'll show you how to use OpenAI ChatGPT API with Java, it's pretty easy.

1. Register for an API key

@gantoin
gantoin / twitch-oauth2-spring-security.md
Last active February 2, 2025 12:34
๐Ÿ“Œ Configure Twitch API OAuth2 provider on a Spring Security app

๐Ÿ“Œ Configure Twitch API OAuth2 provider on a Spring Security app

tags: oauth2, twicth, api

Hi guys, I'm working on a SaaS to manage Twitch Clips of broadcasters:

  • Create vertical Clips automatically for TikTok, Youtube Shorts, etc.
  • Create compilation for clips to easily make best-of

So, I had to plug my Spring Security app into the Twitch OAuth2 provider and it was not easy...

@gantoin
gantoin / frontend-java-development-with-vaadin.md
Last active June 4, 2023 13:06
๐Ÿ’ญ How I became a FullStack Java developer with Vaadin?

๐Ÿ’ญ How I became a FullStack Java developer with Vaadin?

tags: blog, java, vaadin

What is Vaadin?

Vaadin is an open-source framework for building modern web applications. It allows developers to create rich, interactive user interfaces using Java, without the need to learn JavaScript or any other client-side programming language.

Vaadin was first released in 2002 and has since become a popular choice for building enterprise-level applications. It is used by companies such as Nokia, Goldman Sachs, and the United States Air Force, among others.

@gantoin
gantoin / EN-plug-umbrel-nextcloud-to-mobile-app.md
Last active March 9, 2024 20:34
โ˜‚๏ธ How to plug your Umbrel's Nextcloud into the official Nextcloud mobile app? (using Tailescape & some docker commands)

โ˜‚ How to plug your Umbrel's Nextcloud into the official Nextcloud mobile app? (using Tailscale & some docker commands)

tags: umbrel, nextcloud, tailscale

Why you could want to do that?

You could want to use the Nextcloud app to make saving your phone data easier or to get documents from your cloud easily (without a Tor browser, connect via onion etc.).

Why is it not possible natively?