<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <generator>Jekyll v4.4.1</generator>
  <link href="https://tech.asimio.net/feed.xml" rel="self" type="application/atom+xml"/>
  <link href="https://tech.asimio.net" rel="alternate" type="text/html"/>
  <updated>2026-02-03T15:52:51Z</updated>
  <id>https://tech.asimio.net/</id>
  <title type="html">Asimio Tech</title>
  
  <author>
    <name>Orlando L Otero</name>
    <email>orlando.otero@asimio.net</email>
  </author>
  
  <entry>
    <title type="html">Provisioning SNS topics, SQS queues to run integration tests with Testcontainers, LocalStack and Docker for Spring Boot applications</title>
    <link href="https://tech.asimio.net/2025/08/07/sns-sqs-spring-boot-integration-tests-provision-topics-queues-testcontainers-localstack.html" title="Provisioning SNS topics, SQS queues to run integration tests with Testcontainers, LocalStack and Docker for Spring Boot applications" rel="alternate" type="text/html"/>
    <published>2025-08-07T00:00:00Z</published>
    
    <id>https://tech.asimio.net/2025/08/07/sns-sqs-spring-boot-integration-tests-provision-topics-queues-testcontainers-localstack.html</id>
    
    <author>
      <name>Orlando L Otero</name>
      
      <email>orlando.otero@asimio.net</email>
      
    </author>
    
    <category term="aws"/>
    
    <category term="docker"/>
    
    <category term="integration testing"/>
    
    <category term="java"/>
    
    <category term="junit"/>
    
    <category term="messaging"/>
    
    <category term="poc"/>
    
    <category term="sns"/>
    
    <category term="spring boot"/>
    
    <category term="spring cloud"/>
    
    <category term="spring-cloud-aws-starter-sns"/>
    
    <category term="spring-cloud-aws-starter-sqs"/>
    
    <category term="sqs"/>
    
    <category term="testcontainers"/>
    
    <category term="testing"/>
    
    <summary type="html">
      &lt;h3 id=&quot;overview&quot;&gt;1. OVERVIEW&lt;/h3&gt;

&lt;p&gt;Message brokers and messaging systems are fundamental to building resilient distributed applications.&lt;/p&gt;

&lt;p&gt;Both &lt;span class=&quot;codeRef&quot;&gt;AWS&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;SQS&lt;/span&gt; and &lt;span class=&quot;codeRef&quot;&gt;SNS&lt;/span&gt; are messaging systems that facilitate asynchronous communication between different parts of a distributed architecture.&lt;/p&gt;

&lt;p&gt;Your organization’s &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt; applications use different messaging approaches: certain applications &lt;a href=&quot;https://tech.asimio.net/2024/11/19/spring-boot-sns-aws-java-sdk-spring-cloud-aws-starter.html&quot;&gt;send SNS notifications&lt;/a&gt;, others publish messages to &lt;span class=&quot;codeRef&quot;&gt;SQS&lt;/span&gt; queues, while additional applications consume messages from &lt;span class=&quot;codeRef&quot;&gt;SQS&lt;/span&gt; queues or process &lt;span class=&quot;codeRef&quot;&gt;SNS&lt;/span&gt; notifications that have been bridged into &lt;span class=&quot;codeRef&quot;&gt;SQS&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;Along with &lt;a href=&quot;https://tech.asimio.net/2019/04/08/Splitting-Unit-and-Integration-Tests-using-Maven-and-Surefire-plugin.html&quot;&gt;writing unit tests for REST controllers, business logic, etc.&lt;/a&gt;, you should consider writing integration tests to verify the interactions between different systems work well.&lt;/p&gt;

&lt;p&gt;This blog post helps you write a custom &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt;’s &lt;span class=&quot;codeRef&quot;&gt;TestExecutionListener&lt;/span&gt; to automate provisioning &lt;span class=&quot;codeRef&quot;&gt;SQS&lt;/span&gt; queues and &lt;span class=&quot;codeRef&quot;&gt;SNS&lt;/span&gt; topics for &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt; integration tests, ensuring each test starts from a known state and can run independently in any order.&lt;/p&gt;

&lt;p&gt;Additionally, this blog post covers &lt;a href=&quot;https://tech.asimio.net/2024/09/06/Reuse-Testcontainers-initialization-and-configuration-code-with-JUnit-5-Extension-Callbacks-in-Spring-Boot-Integration-Tests.html&quot;&gt;writing a custom Jupiter/JUnit 5 Extension&lt;/a&gt; to share a &lt;span class=&quot;codeRef&quot;&gt;Testcontainers&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;LocalStack&lt;/span&gt; instance across your &lt;span class=&quot;codeRef&quot;&gt;SNS&lt;/span&gt;, &lt;span class=&quot;codeRef&quot;&gt;SQS&lt;/span&gt;-related integration test suite, instead of each integration test class starting a new &lt;span class=&quot;codeRef&quot;&gt;LocalStack&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Docker&lt;/span&gt; container.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://tech.asimio.net/images/integration-tests-spring-boot-provision-sns-sqs-infrastructure-testcontainers-localstack-junit5-extension.png&quot; alt=&quot;Provision SNS topics and SQS queues for testing Spring Boot applications with Testcontainers, LocalStack and JUnit 5 Extension&quot; title=&quot;Provision SNS topics and SQS queues for testing Spring Boot applications with Testcontainers, LocalStack and JUnit 5 Extension&quot; class=&quot;center-image&quot; /&gt;&lt;/p&gt;

    </summary>
    
    <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tech.asimio.net/images/integration-tests-spring-boot-provision-sns-sqs-infrastructure-testcontainers-localstack-junit5-extension.png"/>
    
  </entry>
  
  <entry>
    <title type="html">RESTful API Guidelines</title>
    <link href="https://tech.asimio.net/2025/07/08/restful-api-guidelines.html" title="RESTful API Guidelines" rel="alternate" type="text/html"/>
    <published>2025-07-08T00:00:00Z</published>
    
    <updated>2025-07-13T00:00:00Z</updated>
    
    <id>https://tech.asimio.net/2025/07/08/restful-api-guidelines.html</id>
    
    <author>
      <name>Orlando L Otero</name>
      
      <email>orlando.otero@asimio.net</email>
      
    </author>
    
    <category term="api"/>
    
    <category term="guidelines"/>
    
    <category term="restful"/>
    
    <summary type="html">
      &lt;h3 id=&quot;overview&quot;&gt;1. OVERVIEW&lt;/h3&gt;

&lt;p&gt;&lt;span class=&quot;codeRef&quot;&gt;RESTful&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;API&lt;/span&gt;s started being widely adopted for systems interoperability and integration in the mid-2000s, maybe earlier.&lt;/p&gt;

&lt;p&gt;Two decades later, many &lt;span class=&quot;codeRef&quot;&gt;API&lt;/span&gt;s in production today, that claim to be “&lt;span class=&quot;codeRef&quot;&gt;RESTful&lt;/span&gt;”, violate basic &lt;span class=&quot;codeRef&quot;&gt;REST&lt;/span&gt; principles, creating confusion, frustration, and unnecessary complexity.&lt;/p&gt;

&lt;p&gt;Take for instance:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;POST /accountSearchByNumber&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;POST /accountSearchByLogin&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;POST /DeleteEvent&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Lack of security, either at the protocol level or allowing data access to users/personas not related to it.&lt;/li&gt;
  &lt;li&gt;Operation in the request body.&lt;/li&gt;
  &lt;li&gt;Inconsistent Resource Naming.&lt;/li&gt;
  &lt;li&gt;Returning &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;200 OK&lt;/code&gt; when there was a validation error or an exception.&lt;/li&gt;
  &lt;li&gt;Often times, &lt;a href=&quot;https://tech.asimio.net/2025/07/08/restful-api-guidelines.html#richardson-maturity-model&quot;&gt;level 0 from the Richardson Maturity Model&lt;/a&gt; code.&lt;/li&gt;
  &lt;li&gt;No documentation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This blog post is revised regularly to keep the recommendations for building scalable and secure &lt;span class=&quot;codeRef&quot;&gt;REST&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;API&lt;/span&gt;s up-to-date.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://tech.asimio.net/images/restful-api-guidelines.svg&quot; alt=&quot;RESTful API Guidelines&quot; title=&quot;RESTful API Guidelines&quot; class=&quot;center-image&quot; /&gt;&lt;/p&gt;

    </summary>
    
    <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tech.asimio.net/images/restful-api-guidelines.svg"/>
    
  </entry>
  
  <entry>
    <title type="html">Connecting your Testcontainers integration tests to a remote Docker host</title>
    <link href="https://tech.asimio.net/2025/07/01/testcontainers-integration-tests-remote-docker-host.html" title="Connecting your Testcontainers integration tests to a remote Docker host" rel="alternate" type="text/html"/>
    <published>2025-07-01T00:00:00Z</published>
    
    <updated>2025-08-07T00:00:00Z</updated>
    
    <id>https://tech.asimio.net/2025/07/01/testcontainers-integration-tests-remote-docker-host.html</id>
    
    <author>
      <name>Orlando L Otero</name>
      
      <email>orlando.otero@asimio.net</email>
      
    </author>
    
    <category term="docker"/>
    
    <category term="integration testing"/>
    
    <category term="java"/>
    
    <category term="testcontainers"/>
    
    <category term="testing"/>
    
    <summary type="html">
      &lt;h3 id=&quot;overview&quot;&gt;1. OVERVIEW&lt;/h3&gt;

&lt;p&gt;I have shared how to use &lt;span class=&quot;codeRef&quot;&gt;Testcontainers&lt;/span&gt; to run &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt; &lt;a href=&quot;https://tech.asimio.net/2024/02/28/Cosmos-DB-Spring-Boot-2-Integration-Tests-Testcontainers.html&quot;&gt;CosmosDB&lt;/a&gt;, and &lt;a href=&quot;https://tech.asimio.net/2024/11/22/dynamodb-spring-boot-integration-tests-provisioning-tables-seeding-data.html&quot;&gt;DynamoDB&lt;/a&gt; integration tests locally, meaning in your development workstation or laptop.&lt;/p&gt;

&lt;p&gt;But what if for licensing reasons, or resources constraints you cannot install &lt;span class=&quot;codeRef&quot;&gt;Docker&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Desktop&lt;/span&gt;? &lt;br /&gt;
What if your organization needs to share specialized testing environments not available locally? &lt;br /&gt;
What if your integration tests need to start 3rd party systems to connect to in dedicated build servers as part of your &lt;span class=&quot;codeRef&quot;&gt;CI/CD&lt;/span&gt; pipeline?&lt;/p&gt;

&lt;p&gt;This blog post walks you through how to configure a &lt;span class=&quot;codeRef&quot;&gt;Docker&lt;/span&gt; host to allow remote connections, and  &lt;span class=&quot;codeRef&quot;&gt;Testcontainers&lt;/span&gt; to use a remote &lt;span class=&quot;codeRef&quot;&gt;Docker&lt;/span&gt; host.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://tech.asimio.net/images/testcontainers-docker.png&quot; alt=&quot;Connecting your Testcontainers integration tests to a remote Docker host&quot; title=&quot;Connecting your Testcontainers integration tests to a remote Docker host&quot; class=&quot;center-image&quot; /&gt;&lt;/p&gt;

    </summary>
    
    <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tech.asimio.net/images/testcontainers-docker.png"/>
    
  </entry>
  
  <entry>
    <title type="html">Provisioning AWS DynamoDB tables and seeding data to run integration tests with Testcontainers and Docker for Spring Boot applications</title>
    <link href="https://tech.asimio.net/2024/11/22/dynamodb-spring-boot-integration-tests-provisioning-tables-seeding-data.html" title="Provisioning AWS DynamoDB tables and seeding data to run integration tests with Testcontainers and Docker for Spring Boot applications" rel="alternate" type="text/html"/>
    <published>2024-11-22T00:00:00Z</published>
    
    <updated>2025-08-14T00:00:00Z</updated>
    
    <id>https://tech.asimio.net/2024/11/22/dynamodb-spring-boot-integration-tests-provisioning-tables-seeding-data.html</id>
    
    <author>
      <name>Orlando L Otero</name>
      
      <email>orlando.otero@asimio.net</email>
      
    </author>
    
    <category term="api"/>
    
    <category term="aws"/>
    
    <category term="dynamodb"/>
    
    <category term="integration testing"/>
    
    <category term="java"/>
    
    <category term="junit"/>
    
    <category term="poc"/>
    
    <category term="restful"/>
    
    <category term="spring boot"/>
    
    <category term="spring cloud"/>
    
    <category term="spring-cloud-aws-starter-dynamodb"/>
    
    <category term="testing"/>
    
    <summary type="html">
      &lt;h3 id=&quot;overview&quot;&gt;1. OVERVIEW&lt;/h3&gt;

&lt;p&gt;You are deploying, or planning to deploy your &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;RESTful&lt;/span&gt; applications to &lt;span class=&quot;codeRef&quot;&gt;AWS&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;Some of these &lt;a href=&quot;https://tech.asimio.net/2024/10/28/spring-boot-dynamodb-aws-java-sdk-spring-cloud-aws-starter-dynamic-queries-dynamodbtemplate.html&quot;&gt;Spring Boot applications might use Amazon DynamoDB data stores&lt;/a&gt; instead of relational databases.&lt;/p&gt;

&lt;p&gt;Along with &lt;a href=&quot;https://tech.asimio.net/2019/04/08/Splitting-Unit-and-Integration-Tests-using-Maven-and-Surefire-plugin.html&quot;&gt;writing unit tests for REST controllers, business logic, etc.&lt;/a&gt;, you should consider writing integration tests to verify the interactions between different parts of the system work well, including retrieving data from, and storing data to a &lt;span class=&quot;codeRef&quot;&gt;NoSQL&lt;/span&gt; database like &lt;span class=&quot;codeRef&quot;&gt;DynamoDB&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;This blog post helps you write a custom &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;TestExecutionListener&lt;/span&gt; to populate &lt;span class=&quot;codeRef&quot;&gt;DynamoDB&lt;/span&gt; tables for &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt; integration tests, guaranteeing that every test starts with predictable data.&lt;/p&gt;

&lt;p&gt;The guide also covers &lt;a href=&quot;https://tech.asimio.net/2024/09/06/Reuse-Testcontainers-initialization-and-configuration-code-with-JUnit-5-Extension-Callbacks-in-Spring-Boot-Integration-Tests.html&quot;&gt;writing a custom Jupiter/JUnit 5 Extension&lt;/a&gt; to reuse a shared &lt;span class=&quot;codeRef&quot;&gt;Testcontainers&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;dynamodb-local&lt;/span&gt; instance across all your &lt;span class=&quot;codeRef&quot;&gt;DynamoDB&lt;/span&gt;-related integration tests, preventing each integration test class from creating a new &lt;span class=&quot;codeRef&quot;&gt;dynamodb-local&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Docker&lt;/span&gt; container.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://tech.asimio.net/images/integration-tests-spring-boot-dynamodb-seed-data.png&quot; alt=&quot;Seed data for integration tests in Spring Boot and Amazon DynamoDB applications&quot; title=&quot;Seed data for integration tests in Spring Boot and Amazon DynamoDB applications&quot; class=&quot;center-image&quot; /&gt;&lt;/p&gt;

    </summary>
    
    <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tech.asimio.net/images/integration-tests-spring-boot-dynamodb-seed-data.png"/>
    
  </entry>
  
  <entry>
    <title type="html">Publishing AWS SNS Notifications with Spring Boot, AWS Java SDK v2, and spring-cloud-aws-starter-sns</title>
    <link href="https://tech.asimio.net/2024/11/19/spring-boot-sns-aws-java-sdk-spring-cloud-aws-starter.html" title="Publishing AWS SNS Notifications with Spring Boot, AWS Java SDK v2, and spring-cloud-aws-starter-sns" rel="alternate" type="text/html"/>
    <published>2024-11-19T00:00:00Z</published>
    
    <updated>2025-07-09T00:00:00Z</updated>
    
    <id>https://tech.asimio.net/2024/11/19/spring-boot-sns-aws-java-sdk-spring-cloud-aws-starter.html</id>
    
    <author>
      <name>Orlando L Otero</name>
      
      <email>orlando.otero@asimio.net</email>
      
    </author>
    
    <category term="aws"/>
    
    <category term="aws-cli"/>
    
    <category term="docker"/>
    
    <category term="java"/>
    
    <category term="sns"/>
    
    <category term="spring boot"/>
    
    <category term="spring cloud"/>
    
    <category term="spring-cloud-aws-starter-sns"/>
    
    <summary type="html">
      &lt;h3 id=&quot;overview&quot;&gt;1. OVERVIEW&lt;/h3&gt;

&lt;p&gt;&lt;span class=&quot;codeRef&quot;&gt;Amazon&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;SNS&lt;/span&gt; (Simple Notification Service) is a fully managed topic-based messaging service that helps publishing notifications for subscriber/listener applications to process.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;codeRef&quot;&gt;Amazon&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;SNS&lt;/span&gt; follows the pub/sub model to facilitate asynchronous communication between different systems.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;codeRef&quot;&gt;SNS&lt;/span&gt; supports multiple delivery protocols such as:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;http/https,&lt;/li&gt;
  &lt;li&gt;email,&lt;/li&gt;
  &lt;li&gt;sms&lt;/li&gt;
  &lt;li&gt;&lt;span class=&quot;codeRef&quot;&gt;AWS&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;SQS&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span class=&quot;codeRef&quot;&gt;AWS&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Lambda&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span class=&quot;codeRef&quot;&gt;AWS&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Kinesis&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Data&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Firehose&lt;/span&gt;&lt;/li&gt;
  &lt;li&gt;mobile applications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This blog post helps you to get started publishing notifications with &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;3&lt;/code&gt;, &lt;span class=&quot;codeRef&quot;&gt;SNS&lt;/span&gt;, &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Cloud&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;AWS&lt;/span&gt;, and &lt;span class=&quot;codeRef&quot;&gt;AWS&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Java&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;SDK&lt;/span&gt; version &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2&lt;/code&gt;, and consuming the messages via &lt;span class=&quot;codeRef&quot;&gt;SQS&lt;/span&gt; with &lt;span class=&quot;codeRef&quot;&gt;AWS&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;CLI&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://tech.asimio.net/images/springboot-sns.png&quot; alt=&quot;Spring Boot, Spring Cloud AWS, and SNS&quot; title=&quot;Spring Boot, Spring Cloud AWS, and SNS&quot; class=&quot;center-image&quot; /&gt;&lt;/p&gt;

    </summary>
    
    <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tech.asimio.net/images/springboot-sns.png"/>
    
  </entry>
  
  <entry>
    <title type="html">Getting started with Spring Boot, DynamoDB, AWS Java SDK v2, spring-cloud-aws-starter-dynamodb, and dynamic queries with DynamoDbTemplate</title>
    <link href="https://tech.asimio.net/2024/10/28/spring-boot-dynamodb-aws-java-sdk-spring-cloud-aws-starter-dynamic-queries-dynamodbtemplate.html" title="Getting started with Spring Boot, DynamoDB, AWS Java SDK v2, spring-cloud-aws-starter-dynamodb, and dynamic queries with DynamoDbTemplate" rel="alternate" type="text/html"/>
    <published>2024-10-28T00:00:00Z</published>
    
    <updated>2025-07-09T00:00:00Z</updated>
    
    <id>https://tech.asimio.net/2024/10/28/spring-boot-dynamodb-aws-java-sdk-spring-cloud-aws-starter-dynamic-queries-dynamodbtemplate.html</id>
    
    <author>
      <name>Orlando L Otero</name>
      
      <email>orlando.otero@asimio.net</email>
      
    </author>
    
    <category term="api"/>
    
    <category term="aws"/>
    
    <category term="aws-cli"/>
    
    <category term="docker"/>
    
    <category term="dynamodb"/>
    
    <category term="java"/>
    
    <category term="nosql"/>
    
    <category term="restful"/>
    
    <category term="spring boot"/>
    
    <category term="spring cloud"/>
    
    <category term="spring-cloud-aws-starter-dynamodb"/>
    
    <summary type="html">
      &lt;h3 id=&quot;overview&quot;&gt;1. OVERVIEW&lt;/h3&gt;

&lt;p&gt;If your organization is working, or planning to work with large amount of unstructured data, &lt;span class=&quot;codeRef&quot;&gt;Amazon&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;DynamoDB&lt;/span&gt; would be an option to consider, especially if your organization is already invested in &lt;span class=&quot;codeRef&quot;&gt;AWS&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;codeRef&quot;&gt;DynamoDB&lt;/span&gt; is a schemaless &lt;span class=&quot;codeRef&quot;&gt;NoSQL&lt;/span&gt; (key-value), performant, and scalable database solution.&lt;/p&gt;

&lt;p&gt;This blog post shows you how to get started with &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;3&lt;/code&gt;, &lt;span class=&quot;codeRef&quot;&gt;DynamoDB&lt;/span&gt;, &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Cloud&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;AWS&lt;/span&gt;, and &lt;span class=&quot;codeRef&quot;&gt;AWS&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Java&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;SDK&lt;/span&gt; version &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And continuing with the dynamic queries trend I have covered in the past when the data comes from a relational database:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://tech.asimio.net/2021/07/26/Writing-dynamic-SQL-queries-using-Spring-Data-JPA-Repositories-and-EntityManager.html&quot;&gt;Writing dynamic SQL queries using Spring Data JPA repositories and EntityManager&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://tech.asimio.net/2020/11/21/Implementing-dynamic-SQL-queries-using-Spring-Data-JPA-Specification-and-Criteria-API.html&quot;&gt;Writing dynamic SQL queries using Spring Data JPA Specification and Criteria API&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://tech.asimio.net/2023/01/31/Writing-dynamic-SQL-queries-using-Spring-Data-JPA-Repositories-Hibernate-and-Querydsl.html&quot;&gt;Writing dynamic SQL queries using Spring Data JPA repositories and Querydsl&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;as well as when the data comes from &lt;span class=&quot;codeRef&quot;&gt;Cosmos&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;DB&lt;/span&gt;:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://tech.asimio.net/2023/08/28/Writing-Dynamic-Azure-Cosmos-DB-Queries-Spring-Data-Cosmos-ReactiveCosmosTemplate.html&quot;&gt;Writing dynamic Cosmos DB queries using Spring Data Cosmos repositories and ReactiveCosmosTemplate&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Besides getting started, this blog post also helps you to write dynamic &lt;span class=&quot;codeRef&quot;&gt;DynamoDB&lt;/span&gt; queries with &lt;span class=&quot;codeRef&quot;&gt;DynamoDbTemplate&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://tech.asimio.net/images/springboot-dynamodb.png&quot; alt=&quot;Spring Boot, Spring Cloud AWS, and DynamoDB&quot; title=&quot;Spring Boot, Spring Cloud AWS, and DynamoDB&quot; class=&quot;center-image&quot; /&gt;&lt;/p&gt;

    </summary>
    
    <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tech.asimio.net/images/springboot-dynamodb.png"/>
    
  </entry>
  
  <entry>
    <title type="html">Propagating Tenant data to Spawned/Async Threads with ThreadLocalTargetSource, TaskDecorator in Multi-tenant Spring Boot applications</title>
    <link href="https://tech.asimio.net/2024/09/12/Propagating-data-to-Async-Threads-with-ThreadLocalTargetSource-TaskDecorator-Spring-Boot.html" title="Propagating Tenant data to Spawned/Async Threads with ThreadLocalTargetSource, TaskDecorator in Multi-tenant Spring Boot applications" rel="alternate" type="text/html"/>
    <published>2024-09-12T00:00:00Z</published>
    
    <id>https://tech.asimio.net/2024/09/12/Propagating-data-to-Async-Threads-with-ThreadLocalTargetSource-TaskDecorator-Spring-Boot.html</id>
    
    <author>
      <name>Orlando L Otero</name>
      
      <email>orlando.otero@asimio.net</email>
      
    </author>
    
    <category term="java"/>
    
    <category term="multitenancy"/>
    
    <category term="spring boot"/>
    
    <category term="threadlocal"/>
    
    <category term="threadlocaltargetsource"/>
    
    <summary type="html">
      &lt;h3 id=&quot;overview&quot;&gt;1. OVERVIEW&lt;/h3&gt;

&lt;p&gt;In late 2017, I published a blog post about &lt;a href=&quot;https://tech.asimio.net/2017/11/28/An-alternative-to-ThreadLocal-using-Spring.html&quot;&gt;using Spring’s ThreadLocalTargetSource as an alternative to dealing explicitly with ThreadLocal in Spring Boot Multi-tenant applications&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Where did I use &lt;span class=&quot;codeRef&quot;&gt;ThreadLocal&lt;/span&gt; that I found &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt;’s &lt;span class=&quot;codeRef&quot;&gt;ThreadLocalTargetSource&lt;/span&gt; a useful alternative?&lt;/p&gt;

&lt;p&gt;Let’s start with some context.&lt;/p&gt;

&lt;p&gt;Earlier that same year I had published &lt;a href=&quot;https://tech.asimio.net/2017/01/17/Multitenant-applications-using-Spring-Boot-JPA-Hibernate-and-Postgres.html&quot;&gt;writing multi-tenant RESTful applications with Spring Boot, JPA, Hibernate and Postgres&lt;/a&gt;, where I took the &lt;strong&gt;shared application(s), different databases, multi-tenancy&lt;/strong&gt; approach.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://tech.asimio.net/images/multi-tenancy-shared-application-different-databases.png&quot; alt=&quot;Multi-tenancy - Shared applications, different databases&quot; title=&quot;Multi-tenancy - Shared applications, different databases&quot; class=&quot;center-image&quot; /&gt;
&lt;em&gt;Multi-tenancy - Shared applications, different databases&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The implementation used an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HTTP&lt;/code&gt; Header with the Tenant identifier to choose the relational database from which to retrieve the data from.&lt;/p&gt;

&lt;p&gt;You could send requests like:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -H &quot;X-TENANT-ID: tenant_1&quot; http://localhost:8080/...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -H &quot;X-TENANT-ID: tenant_2&quot; http://localhost:8080/...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The code also included a &lt;a href=&quot;https://tech.asimio.net/resources/code-snippets/add-spring-mvc-interceptor/&quot;&gt;Spring MVC Interceptor&lt;/a&gt; to set and clear the Tenant identifier to and from the &lt;span class=&quot;codeRef&quot;&gt;TenantContext&lt;/span&gt; using that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HTTP&lt;/code&gt; custom header.&lt;/p&gt;

&lt;div class=&quot;alert alert-info&quot; role=&quot;alert&quot;&gt;&lt;i class=&quot;fa fa-info-circle&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt; &lt;b&gt;Note:&lt;/b&gt; 
You could have written a &lt;a href=&quot;/2018/02/24/Implementing-and-configuring-Servlets-Filters-and-Listeners-in-SpringBoot-applications.html&quot;&gt;Servlet Filter&lt;/a&gt; instead.
&lt;/div&gt;

&lt;p id=&quot;multitenant_interceptor_java&quot;&gt;&lt;em&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DvdRentalMultiTenantInterceptor.java&lt;/code&gt;&lt;/em&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;public class DvdRentalMultiTenantInterceptor extends HandlerInterceptorAdapter {

  @Override
  public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
    String tenantId = request.getHeader(TENANT_HEADER_NAME);
    DvdRentalTenantContext.setTenantId(tenantId);
    return true;
  }

  @Override
  public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
    DvdRentalTenantContext.clear();
  }

}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;p id=&quot;tenant_context_java&quot;&gt;&lt;em&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DvdRentalTenantContext.java&lt;/code&gt;&lt;/em&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;public class DvdRentalTenantContext {

  private static final ThreadLocal&amp;lt;String&amp;gt; CONTEXT = new ThreadLocal&amp;lt;&amp;gt;();

  public static void setTenantId(String tenantId) {
    CONTEXT.set(tenantId);
  }

  public static String getTenantId() {
    return CONTEXT.get();
  }

  public static void clear() {
    CONTEXT.remove();
  }

}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can now see how the &lt;a href=&quot;https://tech.asimio.net/2024/09/12/Propagating-data-to-Async-Threads-with-ThreadLocalTargetSource-TaskDecorator-Spring-Boot.html#tenant_context_java&quot;&gt;TenantContext implementation&lt;/a&gt; uses &lt;span class=&quot;codeRef&quot;&gt;Java&lt;/span&gt;’s &lt;span class=&quot;codeRef&quot;&gt;ThreadLocal&lt;/span&gt; to set, retrieve and clear Tenant’s data, through the &lt;a href=&quot;https://tech.asimio.net/2024/09/12/Propagating-data-to-Async-Threads-with-ThreadLocalTargetSource-TaskDecorator-Spring-Boot.html#multitenant_interceptor_java&quot;&gt;DvdRentalMultiTenantInterceptor&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A problem with &lt;span class=&quot;codeRef&quot;&gt;ThreadLocal&lt;/span&gt; is that you have to be very careful how do you use it. You’ve got to be cautions where to set/clear data to/from the &lt;span class=&quot;codeRef&quot;&gt;ThreadLocal&lt;/span&gt; to prevent the tenant’s data from leaking once the thread processing the request is done and back into the pool to process a future request.&lt;/p&gt;

&lt;p&gt;And thus how I &lt;a href=&quot;https://tech.asimio.net/2017/11/28/An-alternative-to-ThreadLocal-using-Spring.html&quot;&gt;wrote about Spring’s ThreadLocalTargetSource as an alternative to using ThreadLocal directly in Spring Boot Multi-tenant applications&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But, there was a problem:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://tech.asimio.net/images/multi-tenancy-async-threadlocaltargetsource-comments.png&quot; alt=&quot;Multi-tenancy - ThreadLocalTargetSource and Async Requests&quot; title=&quot;Multi-tenancy - Multi-tenancy - ThreadLocalTargetSource and Async Requests&quot; class=&quot;center-image&quot; /&gt;
&lt;em&gt;Multi-tenancy - ThreadLocalTargetSource and Async Requests&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The Tenant identifier wasn’t being propagated when sending or processing async requests. And that’s what this blog post helps fixing.&lt;/p&gt;


    </summary>
    
    <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tech.asimio.net/images/tenantfilter-breakpoint-request-2.png"/>
    
  </entry>
  
  <entry>
    <title type="html">Reuse Testcontainers initialization and configuration code with JUnit 5 Extension Callbacks in your Spring Boot Integration Tests</title>
    <link href="https://tech.asimio.net/2024/09/06/Reuse-Testcontainers-initialization-and-configuration-code-with-JUnit-5-Extension-Callbacks-in-Spring-Boot-Integration-Tests.html" title="Reuse Testcontainers initialization and configuration code with JUnit 5 Extension Callbacks in your Spring Boot Integration Tests" rel="alternate" type="text/html"/>
    <published>2024-09-06T00:00:00Z</published>
    
    <updated>2025-08-07T00:00:00Z</updated>
    
    <id>https://tech.asimio.net/2024/09/06/Reuse-Testcontainers-initialization-and-configuration-code-with-JUnit-5-Extension-Callbacks-in-Spring-Boot-Integration-Tests.html</id>
    
    <author>
      <name>Orlando L Otero</name>
      
      <email>orlando.otero@asimio.net</email>
      
    </author>
    
    <category term="api"/>
    
    <category term="azure"/>
    
    <category term="cosmos db"/>
    
    <category term="docker"/>
    
    <category term="integration testing"/>
    
    <category term="java"/>
    
    <category term="junit"/>
    
    <category term="nosql"/>
    
    <category term="restful"/>
    
    <category term="spring boot"/>
    
    <category term="spring cloud"/>
    
    <category term="spring data cosmos"/>
    
    <category term="sql"/>
    
    <category term="testcontainers"/>
    
    <category term="testing"/>
    
    <category term="truststore"/>
    
    <summary type="html">
      &lt;h3 id=&quot;overview&quot;&gt;1. OVERVIEW&lt;/h3&gt;

&lt;p&gt;You are writing integration tests for your &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt; applications with &lt;span class=&quot;codeRef&quot;&gt;Jupiter&lt;/span&gt;/&lt;span class=&quot;codeRef&quot;&gt;JUnit&lt;/span&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;5&lt;/code&gt; and &lt;span class=&quot;codeRef&quot;&gt;Testcontainers&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;Take for instance this test class from &lt;a href=&quot;https://tech.asimio.net/2024/02/28/Cosmos-DB-Spring-Boot-2-Integration-Tests-Testcontainers.html&quot;&gt;Writing integration tests with Testcontainers and Microsoft’s Cosmos DB Docker emulator for Spring Boot applications&lt;/a&gt;:&lt;/p&gt;

&lt;p id=&quot;controller_testcontainers_integration_test_java&quot;&gt;&lt;em&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UserControllerTestContainersIntegrationTest.java&lt;/code&gt;&lt;/em&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;// ...
@Testcontainers
public class UserControllerTestContainersIntegrationTest {

  @Container
  public final static AsimioCosmosDBEmulatorContainer COSMOS_DB_EMULATOR = new AsimioCosmosDBEmulatorContainer();

  @BeforeAll
  public static void setupTruststore() throws Exception {
    // ...
    KeyStoreUtils.extractPublicCert(COSMOS_DB_EMULATOR.getHost(), COSMOS_DB_EMULATOR.getEmulatorEndpointPort(), pemCertPath);

    String trustStorePath = TEMP_FOLDER.getPath() + File.separator + &quot;integration-tests-cosmos-emulator.truststore&quot;;
    KeyStoreUtils.createKeyStore(
      Lists.newArrayList(pemCertPath),
      trustStorePath,
      &quot;changeit&quot;
    );

    System.setProperty(&quot;javax.net.ssl.trustStore&quot;, trustStorePath);
    System.setProperty(&quot;javax.net.ssl.trustStorePassword&quot;, &quot;changeit&quot;);
    System.setProperty(&quot;javax.net.ssl.trustStoreType&quot;, &quot;PKCS12&quot;);
  }

  @DynamicPropertySource
  public static void cosmosDbProperties(DynamicPropertyRegistry registry) throws Exception {
    registry.add(&quot;spring.cloud.azure.cosmos.endpoint&quot;, COSMOS_DB_EMULATOR::getEmulatorEndpoint);
  }

  @Test
  public void shouldRetrieveUserWithIdEqualsTo100() {
    // ...
  }

// ...
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;span class=&quot;codeRef&quot;&gt;AsimioCosmosDBEmulatorContainer&lt;/span&gt; class extends from &lt;span class=&quot;codeRef&quot;&gt;Testcontainers&lt;/span&gt;’ &lt;span class=&quot;codeRef&quot;&gt;GenericContainer&lt;/span&gt; class because its instantiation and configuration got too complex and noisy. &lt;br /&gt;
It makes the code easier to read, maintain, while also helping you to prevent Copy and Paste code in case you need to write more &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt;, &lt;span class=&quot;codeRef&quot;&gt;Cosmos&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;DB&lt;/span&gt;-based integration test classes.&lt;/p&gt;

&lt;p&gt;Also, notice the custom truststore setup for the tests to run. That’s because every time a &lt;span class=&quot;codeRef&quot;&gt;Cosmos&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;DB&lt;/span&gt; emulator &lt;span class=&quot;codeRef&quot;&gt;Docker&lt;/span&gt; container starts, it generates a different self-signed certificate.&lt;/p&gt;

&lt;p&gt;Which by the way, if your &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt; integration tests not only connects to a &lt;span class=&quot;codeRef&quot;&gt;Cosmos&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;DB&lt;/span&gt; emulator &lt;span class=&quot;codeRef&quot;&gt;Docker&lt;/span&gt; container, but also to other &lt;span class=&quot;codeRef&quot;&gt;Docker&lt;/span&gt; containers that also generate self-signed certs, you would also need to add them to the same truststore your tests use, making the testing setup even more complex.&lt;/p&gt;

&lt;p&gt;And lastly, note the &lt;span class=&quot;codeRef&quot;&gt;@DynamicPropertySource&lt;/span&gt; piece needed for the &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt; integration tests to know the &lt;span class=&quot;codeRef&quot;&gt;Cosmos&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;DB&lt;/span&gt; emulator endpoint’s random Host port they’ll send requests to.&lt;/p&gt;

&lt;p&gt;Now the questions that drove me write this blog post:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What if you need to write a couple of dozen integration tests using &lt;span class=&quot;codeRef&quot;&gt;Testcontainers&lt;/span&gt; with a setup similar to the one I described above?&lt;/li&gt;
  &lt;li&gt;How do you run only one &lt;span class=&quot;codeRef&quot;&gt;Docker&lt;/span&gt; container for the tests suite to use instead of starting a new &lt;span class=&quot;codeRef&quot;&gt;Docker&lt;/span&gt; container for each integration test class?&lt;/li&gt;
  &lt;li&gt;How do you write all these &lt;span class=&quot;codeRef&quot;&gt;Testcontainers&lt;/span&gt;’ instantiation and configuration code in a reusable fashion?&lt;/li&gt;
  &lt;li&gt;How do your integration tests or &lt;span class=&quot;codeRef&quot;&gt;Docker&lt;/span&gt; containers share a kind of test context (&lt;span class=&quot;codeRef&quot;&gt;ExtensionContext&lt;/span&gt; in &lt;span class=&quot;codeRef&quot;&gt;Jupiter&lt;/span&gt;/&lt;span class=&quot;codeRef&quot;&gt;JUnit&lt;/span&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;5&lt;/code&gt; parlance) with resources they might need? For instance, a truststore that different &lt;span class=&quot;codeRef&quot;&gt;Docker&lt;/span&gt; containers need to add a self-signed certificate to.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One approach to writing reusable &lt;span class=&quot;codeRef&quot;&gt;Testcontainers&lt;/span&gt; instantiation and configuration code is to use &lt;span class=&quot;codeRef&quot;&gt;Jupiter&lt;/span&gt;/&lt;span class=&quot;codeRef&quot;&gt;JUnit&lt;/span&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;5&lt;/code&gt; Extension Callbacks. And that’s what this blog post covers.&lt;/p&gt;


    </summary>
    
    <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tech.asimio.net/images/user-controller-testcontainers-cosmosdb-integration-tests-junit-callbacks-extension.png"/>
    
  </entry>
  
  <entry>
    <title type="html">Writing integration tests with Testcontainers and Cosmos DB Docker emulator for Spring Boot applications</title>
    <link href="https://tech.asimio.net/2024/02/28/Cosmos-DB-Spring-Boot-2-Integration-Tests-Testcontainers.html" title="Writing integration tests with Testcontainers and Cosmos DB Docker emulator for Spring Boot applications" rel="alternate" type="text/html"/>
    <published>2024-02-28T00:00:00Z</published>
    
    <updated>2024-08-22T00:00:00Z</updated>
    
    <id>https://tech.asimio.net/2024/02/28/Cosmos-DB-Spring-Boot-2-Integration-Tests-Testcontainers.html</id>
    
    <author>
      <name>Orlando L Otero</name>
      
      <email>orlando.otero@asimio.net</email>
      
    </author>
    
    <category term="api"/>
    
    <category term="azure"/>
    
    <category term="cosmos db"/>
    
    <category term="docker"/>
    
    <category term="integration testing"/>
    
    <category term="java"/>
    
    <category term="junit"/>
    
    <category term="nosql"/>
    
    <category term="poc"/>
    
    <category term="restful"/>
    
    <category term="spring boot"/>
    
    <category term="spring cloud"/>
    
    <category term="spring data cosmos"/>
    
    <category term="sql"/>
    
    <category term="testcontainers"/>
    
    <category term="testing"/>
    
    <category term="truststore"/>
    
    <summary type="html">
      &lt;h3 id=&quot;overview&quot;&gt;1. OVERVIEW&lt;/h3&gt;

&lt;p&gt;As part of your organization’s modernization effort, your team is writing &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt; applications that store data to, and retrieve data from &lt;span class=&quot;codeRef&quot;&gt;Azure&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Cosmos&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;DB&lt;/span&gt;s instead of relational databases.&lt;/p&gt;

&lt;p&gt;You might have &lt;a href=&quot;https://tech.asimio.net/2023/08/28/Writing-Dynamic-Azure-Cosmos-DB-Queries-Spring-Data-Cosmos-ReactiveCosmosTemplate.html&quot;&gt;written dynamic Cosmos DB queries using Spring Data Cosmos and ReactiveCosmosTemplate&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Your integration tests might be connecting to a dedicated &lt;span class=&quot;codeRef&quot;&gt;Cosmos&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;DB&lt;/span&gt; hosted in &lt;span class=&quot;codeRef&quot;&gt;Azure&lt;/span&gt;, which increases your organization’s subscription cost.&lt;/p&gt;

&lt;p&gt;You could instead be using a dedicated &lt;span class=&quot;codeRef&quot;&gt;Cosmos&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;DB&lt;/span&gt; emulator &lt;span class=&quot;codeRef&quot;&gt;Docker&lt;/span&gt; container you would need to make sure is running, and which ports it listens on, before you &lt;a href=&quot;https://tech.asimio.net/2023/09/08/Cosmos-DB-Spring-Boot-2-Integration-Tests-Seed-Data.html&quot;&gt;seed test data&lt;/a&gt; and run every test.&lt;/p&gt;

&lt;p&gt;Or you might not have integration tests at all. But you also know integration testing is one of the keys to deploy often and with confidence.&lt;/p&gt;

&lt;p&gt;This blog post shows you how to write integration tests with &lt;span class=&quot;codeRef&quot;&gt;Testcontainers&lt;/span&gt; and the &lt;span class=&quot;codeRef&quot;&gt;Cosmos&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;DB&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Docker&lt;/span&gt; emulator for &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt; applications. &lt;br /&gt;
Listening on available ports instead of hard-coding them. And importing the &lt;span class=&quot;codeRef&quot;&gt;Cosmos&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;DB&lt;/span&gt; self-signed emulator certificate to a temporal &lt;span class=&quot;codeRef&quot;&gt;Java&lt;/span&gt; truststore your tests could use. &lt;br /&gt;
All these automated.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://tech.asimio.net/images/springboot-testcontainers-cosmosdb-docker-emulator.png&quot; alt=&quot;Testcontainers and Cosmos DB Docker emulator&quot; title=&quot;Testcontainers and Cosmos DB Docker emulator&quot; class=&quot;center-image&quot; /&gt;&lt;/p&gt;

    </summary>
    
    <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tech.asimio.net/images/springboot-testcontainers-cosmosdb-docker-emulator.png"/>
    
  </entry>
  
  <entry>
    <title type="html">Deploying Spring Boot applications from a Maven repository to Azure Spring Apps with Azure CLI</title>
    <link href="https://tech.asimio.net/2023/10/26/Deploy-Spring-Boot-Azure-Spring-Apps-Maven-Repository-Azure-CLI.html" title="Deploying Spring Boot applications from a Maven repository to Azure Spring Apps with Azure CLI" rel="alternate" type="text/html"/>
    <published>2023-10-26T00:00:00Z</published>
    
    <id>https://tech.asimio.net/2023/10/26/Deploy-Spring-Boot-Azure-Spring-Apps-Maven-Repository-Azure-CLI.html</id>
    
    <author>
      <name>Orlando L Otero</name>
      
      <email>orlando.otero@asimio.net</email>
      
    </author>
    
    <category term="azure"/>
    
    <category term="azure-cli"/>
    
    <category term="azure spring apps"/>
    
    <category term="java"/>
    
    <category term="maven"/>
    
    <category term="spring boot"/>
    
    <summary type="html">
      &lt;h3 id=&quot;overview&quot;&gt;1. OVERVIEW&lt;/h3&gt;

&lt;p&gt;&lt;span class=&quot;codeRef&quot;&gt;Azure&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Apps&lt;/span&gt; is a platform as a service (&lt;span class=&quot;codeRef&quot;&gt;PaaS&lt;/span&gt;) and one of the services &lt;span class=&quot;codeRef&quot;&gt;Azure&lt;/span&gt; offers for your organization to run &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt; applications.&lt;/p&gt;

&lt;p&gt;With very little effort, you can provision the &lt;span class=&quot;codeRef&quot;&gt;Azure&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Apps&lt;/span&gt; infrastructure required to deploy and run &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Boot&lt;/span&gt; Web, RESTful, Batch, etc. applications. This allows your team to spend more time with the applications’ business logic.&lt;/p&gt;

&lt;p&gt;This blog post covers provisioning the &lt;span class=&quot;codeRef&quot;&gt;Azure&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Spring&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;Apps&lt;/span&gt; infrastructure using &lt;span class=&quot;codeRef&quot;&gt;Azure&lt;/span&gt; &lt;span class=&quot;codeRef&quot;&gt;CLI&lt;/span&gt; to deploy a &lt;a href=&quot;https://tech.asimio.net/2020/09/01/Using-Azure-Blob-Storage-as-your-Maven-Repository.html&quot;&gt;Spring Boot application previously stored in a Maven repository hosted in an Azure Blob Storage container&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://tech.asimio.net/images/azure-spring-apps-deploy-spring-boot.png&quot; alt=&quot;Deploying Spring Boot applications to Azure Spring Apps&quot; title=&quot;Deploying Spring Boot applications to Azure Spring Apps&quot; class=&quot;center-image&quot; /&gt;&lt;/p&gt;

    </summary>
    
    <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tech.asimio.net/images/azure-spring-apps-deploy-spring-boot.png"/>
    
  </entry>
  
</feed>