{"id":19838483,"url":"https://github.com/zapodot/embedded-jms-junit","last_synced_at":"2025-10-18T03:49:04.158Z","repository":{"id":24529792,"uuid":"101637037","full_name":"zapodot/embedded-jms-junit","owner":"zapodot","description":"Convenient library that allows an embedded JMS (ActiveMQ) JMS broker to be set up as a JUnit @Rule","archived":false,"fork":false,"pushed_at":"2024-07-27T11:19:10.000Z","size":168,"stargazers_count":12,"open_issues_count":33,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-07-27T12:34:40.309Z","etag":null,"topics":["activemq","jms","junit","junit-rule","junit4"],"latest_commit_sha":null,"homepage":null,"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/zapodot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-08-28T11:38:23.000Z","updated_at":"2024-07-27T12:34:40.310Z","dependencies_parsed_at":"2023-01-14T01:08:25.511Z","dependency_job_id":"30849d14-8337-4577-88a5-ccb3d8f7c6e3","html_url":"https://github.com/zapodot/embedded-jms-junit","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapodot%2Fembedded-jms-junit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapodot%2Fembedded-jms-junit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapodot%2Fembedded-jms-junit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapodot%2Fembedded-jms-junit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zapodot","download_url":"https://codeload.github.com/zapodot/embedded-jms-junit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224270092,"owners_count":17283677,"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":["activemq","jms","junit","junit-rule","junit4"],"created_at":"2024-11-12T12:17:55.913Z","updated_at":"2025-10-18T03:48:59.098Z","avatar_url":"https://github.com/zapodot.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"embedded-jms-junit\n=================\n\n[![Build Status](https://github.com/zapodot/embedded-jms-junit/workflows/Java%20CI/badge.svg)](https://github.com/zapodot/embedded-jms-junit/actions?query=workflow%3A%22Java+CI%22)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.zapodot/embedded-jms-junit/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.zapodot/embedded-jms-junit)\n[![Apache V2 License](http://img.shields.io/badge/license-Apache%20V2-blue.svg)](//github.com/zapodot/embedded-jms-junit/blob/master/LICENSE)\n[![Libraries.io for GitHub](https://img.shields.io/librariesio/github/zapodot/embedded-jms-junit.svg)](https://libraries.io/github/zapodot/embedded-db-junit)\n[![Coverage Status](https://coveralls.io/repos/github/zapodot/embedded-jms-junit/badge.svg?branch=master)](https://coveralls.io/github/zapodot/embedded-jms-junit?branch=master)\n[![DepShield Badge](https://depshield.sonatype.org/badges/zapodot/embedded-jms-junit/depshield.svg)](https://depshield.github.io)\n\n[JUnit](http://junit.org/) extension that provides a [ActiveMQ Embedded in-memory JMS Broker](http://activemq.apache.org/). \nIt should be compatible with all the usual JMS integration tools such as Apache Camel and Spring JMS Template. Inspired by the [Embedded DB JUnit Rule](//github.com/zapodot/embedded-db-junit) project.\n\n## Why?\n* because you want to test your JMS integration code without being dependent on a running external JMS Broker\n* setting up the broker manually for all your tests requires a lot of boilerplate code\n* I found myself repeating myself and decided that creating this library would make my life easier :-)\n\n## Status\nThis library is distributed through the [Sonatype OSS repo](https://oss.sonatype.org/) and should thus be widely available. Java 8 or higher is required.\nFeedback is more than welcome. Feel free to create issues if you find bugs or have feature requests for future releases :-)\n\n## Changelog\n* version 0.2: rewritten core and added support for JUnit 5 Jupiter\n* version 0.1: initial release\n\n# Usage\n## JUnit 5 (v. 0.2+)\nMore information on JMS support is found in the [project WIKI](//github.com/zapodot/embedded-jms-junit/wiki/Using-with-JUnit-5-Jupiter)\n### Add dependency\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.zapodot\u003c/groupId\u003e\n    \u003cartifactId\u003eembedded-jms-junit5\u003c/artifactId\u003e\n    \u003cversion\u003e0.2\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n### Use ExtendWith to enable the extension and inject the connection factory using @EmbeddedJms\n```java \n@ExtendWith(EmbeddedJmsBroker.class)\nclass EmbeddedJmsBrokerRequestReplySpringTest {\n\n    private static final String TEST_MESSAGE = \"Test message\";\n\n    private static final String DESTINATION = \"queue:destination\";\n\n    /**\n    *  The type of property must be either ConnectionFactory, ActiveMQFactory or URI.\n    *  If it is a URI to the broker is injected\n    */\n    @EmbeddedJms \n    private ConnectionFactory connectionFactory;\n\n    @DisplayName(\"My test\")\n    @Test\n    void testJmsLogic() throws Exception {\n       // make JMS magic\n    }\n    \n    @DisplayName(\"parameterized test\")\n    @Test\n    void connectionFactoryParameter(@EmbeddedJms ConnectionFactory connectionFactory) {\n        // perform JMS magic\n    }\n\n}\n``` \n## JUnit 4\n### Add dependency\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.zapodot\u003c/groupId\u003e\n    \u003cartifactId\u003eembedded-jms-junit\u003c/artifactId\u003e\n    \u003cversion\u003e0.2\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n### Add to JUnit4 test\n```java\n    @Rule\n    public EmbeddedJmsRule embeddedJmsRule = EmbeddedJmsRule.builder().build();\n\n    @Test\n    public void jmsTest() throws Exception {\n        final ConnectionFactory connectionFactory = embeddedJmsRule.connectionFactory();\n        \n        // work your JMS magic\n\n    }\n```\nFor more examples check the JUnit tests in this project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzapodot%2Fembedded-jms-junit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzapodot%2Fembedded-jms-junit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzapodot%2Fembedded-jms-junit/lists"}