{"id":15409116,"url":"https://github.com/oleg-nenashev/mocks-as-code-demo","last_synced_at":"2025-04-19T03:12:47.762Z","repository":{"id":239416217,"uuid":"799438261","full_name":"oleg-nenashev/mocks-as-code-demo","owner":"oleg-nenashev","description":"Demo for the Infrastructure-as-Code in Java","archived":false,"fork":false,"pushed_at":"2024-05-14T11:55:34.000Z","size":328,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T06:43:08.854Z","etag":null,"topics":["gradle","infrastructure-as-code","localstack","pulumi","testcontainers","wiremock"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oleg-nenashev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-12T06:22:44.000Z","updated_at":"2024-05-14T11:55:37.000Z","dependencies_parsed_at":"2024-05-14T12:52:59.370Z","dependency_job_id":null,"html_url":"https://github.com/oleg-nenashev/mocks-as-code-demo","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.0625,"last_synced_commit":"82eba522bf99fecdd87ead0479b2745416f48c14"},"previous_names":["oleg-nenashev/mocks-as-code-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleg-nenashev%2Fmocks-as-code-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleg-nenashev%2Fmocks-as-code-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleg-nenashev%2Fmocks-as-code-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleg-nenashev%2Fmocks-as-code-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oleg-nenashev","download_url":"https://codeload.github.com/oleg-nenashev/mocks-as-code-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249598181,"owners_count":21297464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gradle","infrastructure-as-code","localstack","pulumi","testcontainers","wiremock"],"created_at":"2024-10-01T16:37:22.657Z","updated_at":"2025-04-19T03:12:47.737Z","avatar_url":"https://github.com/oleg-nenashev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mocks as Code for Configuration Management. Demo\n\nCan you do full-stack development with Java? You can!\nAnd what about full-stack platform engineering? You can do it too!\nIn this demo, we build a full-Java implementation for all key aspects of an application:\n\n- The application itself - Spring Boot\n- Build automation - Gradle Build Tool, aka Gradle\n- Test automation - with Testcontainers, WireMock, LocalStack and other Java tools\n- Configuration Management - with [Pulumi for Java](https://www.pulumi.com/docs/languages-sdks/java/)\n- All the build logic - with [Gradle Build Tool](https://gradle.org/), a.k.a Gradle.\n  We will also use [Gradle Build Scan](https://docs.gradle.org/current/userguide/build_scans.html) for troubleshooting\n  the Pulumi SDK issues.\n\nThis demo is created for the Mocks as Code workshop by Oleg Nenashev.\nThe same demo setup can be implemented purely in Kotlin,\nGolang, Python or any other language supported by Pulumi and Testcontainers.\n\n## Presentation\n\nThe presentation for this workshop can be found\n[here](https://speakerdeck.com/onenashev/workshop-mocks-as-code-in-cfg-mgmt)\n\n## Prerequisites\n\n- Java 17\n- IDE of your choice, tested on Intellij IDEA and VS Code\n- Installed Pulumi CLI application and a created account \n  ([Installation Guide](https://www.pulumi.com/docs/install/))\n- Testcontainers-compatible Docker Engine, preferably Docker Desktop\n  (see the requirements [here](https://www.testcontainers.org/supported_docker_environment/))\n- Free-tire account on [Gradle Build Scan / Develocity](https://scans.gradle.com/) \n\nFor Java tools, consider using [sdkman](https://sdkman.io/) for the demo to make it easier:\n\n```shell\nsdk env install\nsdk env\n```\n\n## Workshop Steps\n\n1. Setting up the environment\n2. Testing AWS Service Integrations using LocalStack and Testcontainers,\n   similar to [this guide](https://testcontainers.com/guides/testing-aws-service-integrations-using-localstack/)\n3. Mocking service APIs with WireMock\n4. Infrastructure-as-Code with Pulumi and Pulumi SDK for Java, and using the same stack for\n   Pulumi deployment integration testing\n5. Advanced troubleshooting and observability of the configurations with Gradle Build Scan\n\n## Credits\n\nThe code implementation is based on the\n[aws-java-webserver](https://github.com/pulumi/examples/blob/master/aws-java-webserver)\nexample from [pulumi/examples](https://github.com/pulumi/examples/).\n\nSome bits of the demo are inspired by [Pulumi CLI fo LocalStack](https://github.com/localstack/pulumi-local) wrapper,\nwhich is adapted inside the integration test.\nThe bits of the demo will be converted to a Java implementation for it,\ncontributions are welcome!\n\n## Read More\n\n- [Infrastructure as Code with Java and Pulumi](https://www.pulumi.com/blog/announcing-infrastructure-as-code-with-java-and-pulumi/) by Mikhail Shilkov\n- [Unit testing Pulumi programs](https://www.pulumi.com/docs/using-pulumi/testing/unit/)\n- [Integration testing for Pulumi programs](https://www.pulumi.com/docs/using-pulumi/testing/integration/)\n- [Local Testing With Pulumi](https://www.pulumi.com/blog/local-testing-with-pulumi/)\n- [Using Pulumi with LocalStack](https://docs.localstack.cloud/user-guide/integrations/pulumi/)\n- [Pulumi and LocalStack — beyond the basics](https://delitescere.medium.com/pulumi-and-localstack-beyond-the-basics-d993f3b94d17) by Josh Graham\n- [Testing AWS service integrations using LocalStack](https://testcontainers.com/guides/testing-aws-service-integrations-using-localstack/)\n\n## When something fails\n\nTo force kill the Pulumi stack:\n\n```shell\npulumi stack rm --force oleg-nenashev/mocks-as-code/mocks-as-code-demo\n```\n\n## License\n\nMost of the code is licensed under the Apache License v2,\nunless specified differently.\n\nThe application code is based on the [Testing AWS Service Integrations using LocalStack](https://github.com/testcontainers/tc-guide-testing-aws-service-integrations-using-localstack) demo,\nand, hence, it uses the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleg-nenashev%2Fmocks-as-code-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foleg-nenashev%2Fmocks-as-code-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleg-nenashev%2Fmocks-as-code-demo/lists"}