{"id":10754,"date":"2025-07-21T08:55:28","date_gmt":"2025-07-21T15:55:28","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cosmosdb\/?p=10754"},"modified":"2025-07-21T08:55:28","modified_gmt":"2025-07-21T15:55:28","slug":"integration-testing-for-go-applications-using-testcontainers-and-containerized-databases","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cosmosdb\/integration-testing-for-go-applications-using-testcontainers-and-containerized-databases\/","title":{"rendered":"Integration testing for Go applications using Testcontainers and containerized databases"},"content":{"rendered":"<p>Integration testing has always presented a fundamental challenge: how do you test your application against real dependencies without the complexity of managing external services? Traditional approaches often involve either mocking dependencies (which can miss integration issues) or maintaining separate test environments (which can be expensive and difficult to manage consistently).<\/p>\n<h2><a href=\"https:\/\/dev.to\/abhirockzz\/beyond-mocks-integration-testing-for-go-applications-using-testcontainers-and-containerized-1g45-temp-slug-8513607?preview=2fb30673b8e4f79559e8d834ada166d96e3f71b84c063fca0997fa529f4e3b271da8a6505e170372bf1426aac4bd3c91ba75922645899048f156c7ad#hello-testcontainers\" name=\"hello-testcontainers\"><\/a>Hello Testcontainers!<\/h2>\n<p><a href=\"https:\/\/testcontainers.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Testcontainers<\/a>\u00a0solves this problem elegantly by providing a way to run lightweight, throwaway instances of databases, message brokers, web servers, and other services directly within your test suite. Instead of complex setup scripts or shared test environments, you can spin up real services in Docker containers that exist only for the duration of your tests. The core value proposition is compelling: write tests that run against the actual technologies your application uses in production, while maintaining the isolation and repeatability that good tests require. When your tests complete, the containers are automatically cleaned up, leaving no trace behind.<\/p>\n<p><a href=\"https:\/\/golang.testcontainers.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">Testcontainers for Go<\/a>\u00a0(<a href=\"https:\/\/pkg.go.dev\/github.com\/testcontainers\/testcontainers-go\" target=\"_blank\" rel=\"noopener noreferrer\">testcontainers-go<\/a>\u00a0package) brings this powerful testing approach to the Go ecosystem. It provides a clean, idiomatic Go API for creating and managing Docker containers within your test suite, handling the lifecycle management, port mapping, and health checks automatically.<a href=\"https:\/\/dev.to\/abhirockzz\/beyond-mocks-integration-testing-for-go-applications-using-testcontainers-and-containerized-1g45-temp-slug-8513607?preview=2fb30673b8e4f79559e8d834ada166d96e3f71b84c063fca0997fa529f4e3b271da8a6505e170372bf1426aac4bd3c91ba75922645899048f156c7ad#what-youll-learn\" name=\"what-youll-learn\"><\/a><\/p>\n<p>This post walks through a practical example of using\u00a0<code>testcontainers-go<\/code>\u00a0with the Azure Cosmos DB emulator. Azure Cosmos DB offers fully-featured Docker containers that mimic the behavior of the cloud service, making it an excellent candidate for integration testing with Testcontainers. Whether you&#8217;re building applications that will eventually run against Azure Cosmos DB, or you&#8217;re simply exploring document database patterns, the emulator provides a realistic testing environment without requiring cloud resources.<\/p>\n<p><div class=\"alert alert-info\">There are two flavors of the Azure Cosmos DB emulator. In this example, I have used the <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/cosmos-db\/emulator-linux\">Linux-based emulator<\/a> (in preview) (which runs, almost anywhere, including ARM64 architecture). You are welcome to <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/cosmos-db\/emulator?context=%2Fazure%2Fcosmos-db%2Fnosql%2Fcontext%2Fcontext\">try out the other version as well<\/a>.<\/div><\/p>\n<p>We&#8217;ll examine a simple application with a focus on how\u00a0<code>testcontainers<\/code>\u00a0handles the container setup, test execution, and cleanup. The app uses the\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/cosmos-db\/nosql\/sdk-go\" target=\"_blank\" rel=\"noopener noreferrer\">Go SDK for Azure Cosmos DB<\/a>\u00a0(<a href=\"https:\/\/pkg.go.dev\/github.com\/Azure\/azure-sdk-for-go\/sdk\/data\/azcosmos\" target=\"_blank\" rel=\"noopener noreferrer\">azcosmos<\/a> package) and exposes a simple REST API that manages items in a container:<\/p>\n<ul>\n<li><code>POST \/items<\/code>\u00a0&#8211; Creates a new item with name, description, and category<\/li>\n<li><code>GET \/items\/{id}?category={category}<\/code>\u00a0&#8211; Retrieves an item by ID and category<\/li>\n<\/ul>\n<h2>Testcontainers and Azure Cosmos DB emulator in action<\/h2>\n<p>Let&#8217;s see\u00a0<code>testcontainers<\/code>\u00a0in action with a practical example. The tests demonstrate how\u00a0<code>testcontainers<\/code> automatically spins up a container (for the emulator), runs our integration tests against it, and cleans up afterward. This gives us the confidence of testing against real database behavior without the complexity of managing external services.<\/p>\n<h3><a href=\"https:\/\/dev.to\/abhirockzz\/beyond-mocks-integration-testing-for-go-applications-using-testcontainers-and-containerized-1g45-temp-slug-8513607?preview=2fb30673b8e4f79559e8d834ada166d96e3f71b84c063fca0997fa529f4e3b271da8a6505e170372bf1426aac4bd3c91ba75922645899048f156c7ad#running-the-tests\" name=\"running-the-tests\"><\/a>Running the tests<\/h3>\n<p>Before we examine the code, let&#8217;s run the tests to see\u00a0<code>testcontainers<\/code>\u00a0in action. Make sure you have\u00a0<a href=\"https:\/\/go.dev\/doc\/install\" target=\"_blank\" rel=\"noopener noreferrer\">Go installed<\/a>\u00a0and Docker running on your machine. If you don&#8217;t have Docker installed, you can follow the instructions on the\u00a0<a href=\"https:\/\/docs.docker.com\/get-docker\/\" target=\"_blank\" rel=\"noopener noreferrer\">Docker website<\/a>.<\/p>\n<p>Pull the Azure Cosmos DB emulator image from Docker Hub:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">docker pull mcr.microsoft.com\/cosmosdb\/linux\/azure-cosmos-emulator:vnext-preview\r\n<\/code><\/pre>\n<p>Next, clone the repository and run the tests. The test suite will automatically start the emulator in a Docker container, run the integration tests, and then clean up the container afterward.<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">git clone github.com\/abhirockzz\/cosmosdb-testcontainers-go\r\ncd cosmosdb-testcontainers-go\r\n\r\ngo test -v .\/...<\/code><\/pre>\n<p>You should see the tests passing with output similar to this (some lines removed for brevity):<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">github.com\/testcontainers\/testcontainers-go - Connected to docker: \r\n  Server Version: 28.3.0\r\n  API Version: 1.48\r\n  Operating System: Docker Desktop\r\n  Total Memory: 7836 MB\r\n\/\/.....\r\n\ud83d\udc33 Creating container for image mcr.microsoft.com\/cosmosdb\/linux\/azure-cosmos-emulator:vnext-preview\r\n\ud83d\udc33 Creating container for image testcontainers\/ryuk:0.11.0\r\n\u2705 Container created: 5e43ec4bd8ea\r\n\ud83d\udc33 Starting container: 5e43ec4bd8ea\r\n\u2705 Container started: 5e43ec4bd8ea\r\n\u23f3 Waiting for container id 5e43ec4bd8ea image: testcontainers\/ryuk:0.11.0. Waiting for: &amp;{Port:8080\/tcp timeout:&lt;nil&gt; PollInterval:100ms skipInternalCheck:false}\r\n\ud83d\udd14 Container is ready: 5e43ec4bd8ea\r\n\u2705 Container created: cb1d2abb7255\r\n\ud83d\udc33 Starting container: cb1d2abb7255\r\n\u2705 Container started: cb1d2abb7255\r\n\u23f3 Waiting for container id cb1d2abb7255 image: mcr.microsoft.com\/cosmosdb\/linux\/azure-cosmos-emulator:vnext-preview. Waiting for: &amp;{Port:8081 timeout:&lt;nil&gt; PollInterval:100ms skipInternalCheck:false}\r\n\ud83d\udd14 Container is ready: cb1d2abb7255\r\n=== RUN   TestCreateItem\r\n--- PASS: TestCreateItem (0.00s)\r\n=== RUN   TestCreateItem_FailureScenarios\r\n\/\/.....\r\n--- PASS: TestCreateItem_FailureScenarios (0.00s)\r\n    --- PASS: TestCreateItem_FailureScenarios\/missing_name (0.00s)\r\n    --- PASS: TestCreateItem_FailureScenarios\/missing_category (0.00s)\r\n    --- PASS: TestCreateItem_FailureScenarios\/invalid_JSON (0.00s)\r\n    --- PASS: TestCreateItem_FailureScenarios\/wrong_HTTP_method (0.00s)\r\n=== RUN   TestGetItem\r\n--- PASS: TestGetItem (0.00s)\r\n=== RUN   TestGetItem_FailureScenarios\r\n\/\/....\r\n--- PASS: TestGetItem_FailureScenarios (0.00s)\r\n    --- PASS: TestGetItem_FailureScenarios\/missing_item_ID (0.00s)\r\n    --- PASS: TestGetItem_FailureScenarios\/missing_category_parameter (0.00s)\r\n    --- PASS: TestGetItem_FailureScenarios\/empty_category_parameter (0.00s)\r\n    --- PASS: TestGetItem_FailureScenarios\/non-existent_item_ID (0.00s)\r\n    --- PASS: TestGetItem_FailureScenarios\/valid_item_ID_but_wrong_category (0.00s)\r\nPASS\r\n\ud83d\udc33 Stopping container: cb1d2abb7255\r\n\u2705 Container stopped: cb1d2abb7255\r\n\ud83d\udc33 Terminating container: cb1d2abb7255\r\n\ud83d\udeab Container terminated: cb1d2abb7255\r\nok      demo    9.194s\r\n<\/code><\/pre>\n<h3>Understanding the test flow<\/h3>\n<p>The output shows how\u00a0<code>testcontainers<\/code>\u00a0orchestrates the entire process in three distinct phases:<\/p>\n<ul>\n<li>Container Setup Phase:\u00a0<code>testcontainers<\/code> connects to Docker, starts the emulator and Ryuk containers, and waits until the emulator is ready for use.<\/li>\n<li>Test Execution Phase: Integration tests run against the live container, covering both successful operations and various error scenarios to ensure robust handling.<\/li>\n<li>Cleanup Phase: All containers are automatically stopped and removed, ensuring the system is left clean with no lingering resources.<\/li>\n<\/ul>\n<p>The combination of\u00a0<code>testcontainers<\/code> and the emulator gives you the reliability of testing against services without the operational overhead of managing test infrastructure. Every test run is isolated, repeatable, and starts from a known clean state. It gives you fast feedback while maintaining the confidence that comes from testing against actual database behavior.<\/p>\n<h2>Deep dive<\/h2>\n<p>Now let&#8217;s examine how this works by walking through the code and exploring the key components that make this work.<\/p>\n<h3>Orchestrating the test environment<\/h3>\n<p>The\u00a0<a href=\"https:\/\/pkg.go.dev\/testing#hdr-Main\" target=\"_blank\" rel=\"noopener noreferrer\">TestMain<\/a>\u00a0function serves as the entry point for our test suite, providing a way to perform setup and teardown operations that span multiple test functions. Unlike individual test functions that run in isolation,\u00a0<code>TestMain<\/code>\u00a0runs once per package and gives you control over the entire test execution lifecycle.<\/p>\n<\/div>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"prettyprint language-go\"><code class=\"language-go\">func TestMain(m *testing.M) {\r\n    \/\/ Set up the CosmosDB emulator container\r\n    ctx := context.Background()\r\n\r\n    var err error\r\n    emulator, err = setupCosmosDBEmulator(ctx)\r\n    if err != nil {\r\n        fmt.Printf(\"Failed to set up CosmosDB emulator: %v\\n\", err)\r\n        os.Exit(1)\r\n    }\r\n\r\n    \/\/ ... client setup and data seeding\r\n\r\n    \/\/ Run the tests\r\n    code := m.Run()\r\n\r\n    \/\/ Cleanup\r\n    if emulator != nil {\r\n        _ = emulator.Terminate(ctx)\r\n    }\r\n\r\n    os.Exit(code)\r\n}\r\n<\/code><\/pre>\n<p>This structure ensures that the expensive operation of starting a Docker container happens only once, while all individual tests can run against the same container instance. The pattern is particularly valuable when your setup involves external resources like databases or message brokers.<\/p>\n<h3><a href=\"https:\/\/dev.to\/abhirockzz\/beyond-mocks-integration-testing-for-go-applications-using-testcontainers-and-containerized-1g45-temp-slug-8513607?preview=2fb30673b8e4f79559e8d834ada166d96e3f71b84c063fca0997fa529f4e3b271da8a6505e170372bf1426aac4bd3c91ba75922645899048f156c7ad#setting-up-the-cosmos-db-emulator\" name=\"setting-up-the-cosmos-db-emulator\"><\/a>Setting up the Azure Cosmos DB emulator<\/h3>\n<p>The\u00a0<code>setupCosmosDBEmulator<\/code>\u00a0function encapsulates the logic for creating and\u00a0<strong>starting<\/strong> the emulator:<\/p>\n<\/div>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"prettyprint language-go\"><code class=\"language-go\">func setupCosmosDBEmulator(ctx context.Context) (testcontainers.Container, error) {\r\n\r\n    req := testcontainers.ContainerRequest{\r\n        Image:        emulatorImage,\r\n        ExposedPorts: []string{emulatorPort + \":8081\"},\r\n        WaitingFor:   wait.ForListeningPort(nat.Port(emulatorPort)),\r\n        Env: map[string]string{\r\n            \"ENABLE_EXPLORER\": \"false\",\r\n            \"PROTOCOL\":        \"https\",\r\n        },\r\n    }\r\n\r\n    container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{\r\n        ContainerRequest: req,\r\n        Started:          true,\r\n    })\r\n\r\n    \/\/ Give the emulator a bit more time to fully initialize\r\n    time.Sleep(5 * time.Second)\r\n\r\n    return container, nil\r\n}<\/code><\/pre>\n<p>The\u00a0<code>ContainerRequest<\/code>\u00a0struct defines everything\u00a0<code>testcontainers<\/code>\u00a0needs to know about our desired container. The\u00a0<code>ExposedPorts<\/code>\u00a0field maps the container&#8217;s internal port\u00a0<code>8081<\/code>\u00a0to the same port on the host, while\u00a0<code>WaitingFor<\/code>\u00a0ensures\u00a0<code>testcontainers<\/code> doesn&#8217;t consider the container ready until the emulator is actually listening on that port. The environment variables configure the emulator to run in HTTPS (<code>PROTOCOL<\/code>) mode without the web-based data explorer (<code>ENABLE_EXPLORER<\/code>\u00a0is set to\u00a0<code>false<\/code>). I encourage you to explore the\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/cosmos-db\/emulator-linux#docker-commands\" target=\"_blank\" rel=\"noopener noreferrer\">documentation<\/a>\u00a0for more configuration options that might suit your testing needs.<\/p>\n<h3>Connecting to the emulator<\/h3>\n<p>The\u00a0<code>auth.GetEmulatorClientWithAzureADAuth<\/code>\u00a0function is part of the\u00a0<a href=\"https:\/\/github.com\/abhirockzz\/cosmosdb-go-sdk-helper\" target=\"_blank\" rel=\"noopener noreferrer\">cosmosdb-go-sdk-helper<\/a>\u00a0package. It provides a convenient way to create a Azure Cosmos DB client that uses <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/cosmos-db\/security\">Microsoft Entra ID authentication<\/a>, which is the recommended approach for production applications. However, in this test setup, <code>GetEmulatorClientWithAzureADAuth<\/code> creates a\u00a0<a href=\"https:\/\/pkg.go.dev\/github.com\/Azure\/azure-sdk-for-go\/sdk\/data\/azcosmos#ContainerClient\" target=\"_blank\" rel=\"noopener noreferrer\">client<\/a> instance configured specifically for the emulator environment. By passing the custom transport through the <code>ClientOptions<\/code>, we ensure that the SDK can successfully connect to the emulator despite its self-signed certificate.<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"prettyprint language-go\"><code class=\"language-go\">transport := &amp;http.Client{Transport: &amp;http.Transport{\r\n    TLSClientConfig: &amp;tls.Config{InsecureSkipVerify: true},\r\n}}\r\n\r\noptions := &amp;azcosmos.ClientOptions{ClientOptions: azcore.ClientOptions{\r\n    Transport: transport,\r\n}}\r\n\r\nclient, err = auth.GetEmulatorClientWithAzureADAuth(emulatorEndpoint, options)\r\n<\/code><\/pre>\n<p><div class=\"alert alert-warning\">Note that <code>InsecureSkipVerify: true<\/code> should <strong>not<\/strong> be used in production environments. <\/div><\/p>\n<\/div>\n<\/div>\n<div>\n<div class=\"crayons-article__main \">\n<div id=\"article-body\" class=\"crayons-article__body text-styles spec__body\" data-article-id=\"2677682\">\n<h3>Test execution and cleanup<\/h3>\n<p>After the container is ready and the client is configured, the code seeds test data through\u00a0<code>seedTestData()<\/code>\u00a0to provide known items for the tests to work with.\u00a0<code>m.Run()<\/code>\u00a0then executes all the actual test functions, returning an exit code that indicates whether the tests passed or failed.<\/p>\n<p>Finally, the\u00a0<code>emulator.Terminate(ctx)<\/code>\u00a0call in the cleanup section ensures that\u00a0<code>testcontainers<\/code>\u00a0properly stops and removes the Docker container, regardless of the test results. This cleanup is essential for preventing resource leaks and ensuring that subsequent test runs start with a clean slate.<\/p>\n<h2><a href=\"https:\/\/dev.to\/abhirockzz\/beyond-mocks-integration-testing-for-go-applications-using-testcontainers-and-containerized-1g45-temp-slug-8513607?preview=2fb30673b8e4f79559e8d834ada166d96e3f71b84c063fca0997fa529f4e3b271da8a6505e170372bf1426aac4bd3c91ba75922645899048f156c7ad#conclusion\" name=\"conclusion\"><\/a>Conclusion<\/h2>\n<p>With the right tools, the complexity of integration testing can be tamed. Testcontainers bridges this gap by making it easier to test against containerised services while maintaining isolation, repeatability, and eliminating the need for shared infrastructure.<\/p>\n<p>While this example focused on Azure Cosmos DB, the patterns apply broadly to any service that offers Docker containers, including PostgreSQL, Kafka, and more. Start with a single service and expand your test coverage gradually.<\/p>\n<p>Although the Azure Cosmos DB emulator is a powerful tool for local development and testing, but it does not support every feature available in the full Azure Cosmos DB service. You can can read on the <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/cosmos-db\/emulator?context=%2Fazure%2Fcosmos-db%2Fnosql%2Fcontext%2Fcontext#differences-between-the-emulator-and-cloud-service\" target=\"_blank\" rel=\"noopener noreferrer\">Differences between the emulator and cloud service<\/a>, or consult the\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/cosmos-db\/emulator-linux#feature-support\" target=\"_blank\" rel=\"noopener noreferrer\">documentation<\/a>\u00a0to understand the subset of features that are supported in the emulator.<\/p>\n<p>The full example code is available in the\u00a0<a href=\"https:\/\/github.com\/abhirockzz\/cosmosdb-testcontainers-go\" target=\"_blank\" rel=\"noopener noreferrer\">GitHub repository<\/a>, and the\u00a0<a href=\"https:\/\/golang.testcontainers.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">testcontainers-go documentation<\/a>\u00a0provides comprehensive guidance for exploring more.<\/p>\n<p>Happy building!<\/p>\n<div class=\"crayons-article__main \">\n<div class=\"js-billboard-container body-billboard-container\" data-async-url=\"\/abhirockzz\/scaling-multi-tenant-go-applications-choosing-the-right-database-partitioning-approach-2amd\/bmar11\/post_body_bottom\">\n<div>\n<h2>About Azure Cosmos DB<\/h2>\n<article id=\"post-10622\" class=\"middle-column pe-xl-198\" data-clarity-region=\"article\">\n<div class=\"entry-content sharepostcontent \" data-bi-area=\"body_article\" data-bi-id=\"post_page_body_article\">\n<p>Azure Cosmos DB is a fully managed and serverless distributed database for modern app development, with SLA-backed speed and availability, automatic and instant scalability, and support for open-source PostgreSQL, MongoDB, and Apache Cassandra. To stay in the loop on Azure Cosmos DB updates, follow us on\u00a0<a href=\"https:\/\/twitter.com\/AzureCosmosDB\" target=\"_blank\" rel=\"noopener\">X<\/a>,\u00a0<a href=\"https:\/\/aka.ms\/AzureCosmosDBYouTube\" target=\"_blank\" rel=\"noopener\">YouTube<\/a>, and\u00a0<a href=\"https:\/\/www.linkedin.com\/company\/azure-cosmos-db\/\" target=\"_blank\" rel=\"noopener\">LinkedIn<\/a>.<\/p>\n<p>To easily build your first database, watch our\u00a0<a href=\"https:\/\/youtube.com\/playlist?list=PLmamF3YkHLoLLGUtSoxmUkORcWaTyHlXp\" target=\"_blank\" rel=\"noopener\">Get Started videos<\/a>\u00a0on YouTube and explore ways to\u00a0<a href=\"https:\/\/docs.microsoft.com\/azure\/cosmos-db\/optimize-dev-test\" target=\"_blank\" rel=\"noopener\">dev\/test free.<\/a><\/p>\n<\/div>\n<\/article>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"js-billboard-container body-billboard-container\" data-async-url=\"\/abhirockzz\/beyond-mocks-integration-testing-for-go-applications-using-testcontainers-and-containerized-1g45-temp-slug-8513607\/bmar11\/post_body_bottom\">\n<div><\/div>\n<\/div>\n<\/div>\n<section id=\"comments\" class=\"text-padding mb-4 border-t-1 border-0 border-solid border-base-10\" data-follow-button-container=\"true\" data-updated-at=\"2025-07-20 17:19:43 UTC\">\n<header class=\"relative flex justify-between items-center mb-6\">\n<div class=\"flex items-center\"><\/div>\n<\/header>\n<\/section>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Integration testing has always presented a fundamental challenge: how do you test your application against real dependencies without the complexity of managing external services? Traditional approaches often involve either mocking dependencies (which can miss integration issues) or maintaining separate test environments (which can be expensive and difficult to manage consistently). Hello Testcontainers! Testcontainers\u00a0solves this problem [&hellip;]<\/p>\n","protected":false},"author":181737,"featured_media":10755,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,1935],"tags":[499,1933,1783],"class_list":["post-10754","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-core-sql-api","category-go-sdk","tag-azure-cosmos-db","tag-devops","tag-docker"],"acf":[],"blog_post_summary":"<p>Integration testing has always presented a fundamental challenge: how do you test your application against real dependencies without the complexity of managing external services? Traditional approaches often involve either mocking dependencies (which can miss integration issues) or maintaining separate test environments (which can be expensive and difficult to manage consistently). Hello Testcontainers! Testcontainers\u00a0solves this problem [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/10754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/users\/181737"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/comments?post=10754"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/10754\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media\/10755"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media?parent=10754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/categories?post=10754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/tags?post=10754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}