{"id":25776086,"url":"https://github.com/MicroShed/microshed-testing","last_synced_at":"2025-02-27T06:05:32.874Z","repository":{"id":35543228,"uuid":"199874469","full_name":"MicroShed/microshed-testing","owner":"MicroShed","description":"A test framework for black-box testing MicroProfile and Jakarta EE applications","archived":false,"fork":false,"pushed_at":"2025-02-20T15:13:19.000Z","size":2048,"stargazers_count":65,"open_issues_count":21,"forks_count":24,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-23T23:34:55.520Z","etag":null,"topics":["docker","hacktoberfest","integration-testing","jakartaee","java","microprofile","system-testing","testing-framework"],"latest_commit_sha":null,"homepage":"https://microshed.org/microshed-testing/","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/MicroShed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2019-07-31T14:40:13.000Z","updated_at":"2025-02-20T15:13:21.000Z","dependencies_parsed_at":"2022-08-24T09:21:25.779Z","dependency_job_id":"57758b2d-aa57-46a2-97f0-b9510612d534","html_url":"https://github.com/MicroShed/microshed-testing","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroShed%2Fmicroshed-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroShed%2Fmicroshed-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroShed%2Fmicroshed-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroShed%2Fmicroshed-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MicroShed","download_url":"https://codeload.github.com/MicroShed/microshed-testing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240987435,"owners_count":19889333,"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":["docker","hacktoberfest","integration-testing","jakartaee","java","microprofile","system-testing","testing-framework"],"created_at":"2025-02-27T06:01:17.634Z","updated_at":"2025-02-27T06:05:32.867Z","avatar_url":"https://github.com/MicroShed.png","language":"Java","readme":"[![MicroShed Testing](docs/images/microshed-testing.png)](http://microshed.org/microshed-testing)\n\n[![Maven Central](https://img.shields.io/maven-central/v/org.microshed/microshed-testing-testcontainers.svg?label=Maven%20Central)](https://mvnrepository.com/artifact/org.microshed/microshed-testing-testcontainers)\n[![Javadocs](https://www.javadoc.io/badge/org.microshed/microshed-testing-testcontainers.svg)](https://www.javadoc.io/doc/org.microshed/microshed-testing-testcontainers)\n[![Website](https://img.shields.io/website/http/microshed.org/microshed-testing?up_color=informational)](http://microshed.org/microshed-testing)\n[![Build Status](https://github.com/MicroShed/microshed-testing/workflows/MicroShed%20CI/badge.svg)](https://github.com/MicroShed/microshed-testing/actions?query=workflow%3A%22MicroShed+CI%22)\n[![License](https://img.shields.io/badge/License-ASL%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)\n\n# Why use MicroShed Testing?\n\nMicroShed Testing offers a fast and simple way of writing and running true-to-production integration\ntests for Java microservice applications. MicroShed Testing exercises your containerized application\nfrom outside the container so you are testing the exact same image that runs in production.\n\nMicroShed Testing aims to:\n1. be easy to get started with\n1. work with any Java EE, Jakarta EE or MicroProfile runtime\n1. provide true-to-production tests\n\n# How to try out a sample locally:\n\n### Run with Maven:\n```bash\n./gradlew publishToMavenLocal\ncd sample-apps/maven-app\nmvn clean install\n```\n\n### Run with Gradle:\n```\n./gradlew :microshed-testing-jaxrs-json:test\n```\n\nNOTE: The first run will take longer due to downloading required container layers. Subsequent runs will be faster.\n\nNOTE: If a container is consistantly timing out on your system you can set a longer timeout (in seconds) with the system property\n`microshed.testing.startup.timeout` default value is 60 seconds.\n\nNOTE: If a mockserver has started, but HTTP calls are consistantly timing out on your system you can set a longer timeout (in milliseconds)\nwith the system property `mockserver.maxSocketTimeout` default value is 120000 milliseconds.\n\n# Supported application-servers:\n- OpenLiberty\n- Wildfly\n- Payara Micro / Full\n- Quarkus\n\n# Supported runtimes:\n`microshed-testing-core` supports the Javax namespace up to and including version 0.9.2. Starting from version 0.9.3, the Jakarta namespace is supported.\n\n# Quick Start\n\nTo get started writing a test with MicroShed Testing, add `system-test` and `junit-jupiter` as test-scoped dependencies:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.microshed\u003c/groupId\u003e\n    \u003cartifactId\u003emicroshed-testing-testcontainers\u003c/artifactId\u003e\n    \u003cversion\u003e0.9.2\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n\n\u003c!-- Any compatible version of JUnit Jupiter 5.X will work --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.junit.jupiter\u003c/groupId\u003e\n    \u003cartifactId\u003ejunit-jupiter\u003c/artifactId\u003e\n    \u003cversion\u003e5.10.1\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nOnce you have the above dependencies added, create a new test class with the following items:\n1. Annotate the class with `@MicroShedTest`\n1. Create a `public static ApplicationContainer` field\n1. Inject one or more `public static` JAX-RS resource classes\n\n```java\nimport org.microshed.testing.jaxrs.RESTClient;\nimport org.microshed.testing.jupiter.MicroShedTest;\nimport org.microshed.testing.testcontainers.ApplicationContainer;\nimport org.testcontainers.junit.jupiter.Container;\n\n@MicroShedTest\npublic class MyTest {\n\n    @Container\n    public static ApplicationContainer app = new ApplicationContainer()\n                    .withAppContextRoot(\"/myservice\");\n                    \n    @RESTClient\n    public static MyService mySvc;\n    \n    // write @Test methods as normal\n}\n```\n\nIf the repository containing the tests does not have a `Dockerfile` in it, there are a few other options:\n\n* If the application's container image is produced by a different repository, a String docker image label can be\n  supplied instead:\n\n```java\n    @Container\n    public static ApplicationContainer app = new ApplicationContainer(\"myservice:latest\")\n                    .withAppContextRoot(\"/myservice\");\n```\n* If a Dockerfile or container image label is not available, it is possible to use vendor-specific adapters that will\n  provide the default logic for building an application container. For example, the `microshed-testing-liberty` adapter will\n  automatically produce a testable container image roughly equivalent to the following Dockerfile:\n\n```\nFROM openliberty/open-liberty:full-java17-openj9-ubi\nCOPY src/main/liberty/config /config/\nADD target/$APP_FILE /config/dropins\n```\n\nFor a more complete introduction, see the [Walkthrough page](https://microshed.org/microshed-testing/features/Walkthrough.html)","funding_links":[],"categories":["测试"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMicroShed%2Fmicroshed-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMicroShed%2Fmicroshed-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMicroShed%2Fmicroshed-testing/lists"}