{"id":16515057,"url":"https://github.com/sdorra/junit-shiro-extension","last_synced_at":"2025-10-18T05:54:36.183Z","repository":{"id":57722641,"uuid":"347872211","full_name":"sdorra/junit-shiro-extension","owner":"sdorra","description":"Simplify unit tests with JUnit 5 and Apache Shiro","archived":false,"fork":false,"pushed_at":"2021-03-24T16:36:20.000Z","size":558,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-13T03:13:35.550Z","etag":null,"topics":["apache-shiro","java","junit5","junit5-extension","testing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sdorra.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}},"created_at":"2021-03-15T07:15:38.000Z","updated_at":"2021-03-24T16:36:23.000Z","dependencies_parsed_at":"2022-08-28T10:10:59.810Z","dependency_job_id":null,"html_url":"https://github.com/sdorra/junit-shiro-extension","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/sdorra%2Fjunit-shiro-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdorra%2Fjunit-shiro-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdorra%2Fjunit-shiro-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdorra%2Fjunit-shiro-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdorra","download_url":"https://codeload.github.com/sdorra/junit-shiro-extension/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241533650,"owners_count":19977826,"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":["apache-shiro","java","junit5","junit5-extension","testing"],"created_at":"2024-10-11T16:14:58.460Z","updated_at":"2025-10-18T05:54:36.106Z","avatar_url":"https://github.com/sdorra.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"JUnit Shiro Extension\" src=\"images/title.jpg\" width=\"640\" height=\"275\" /\u003e\n\u003c/p\u003e\n\n# JUnit Shiro Extension\n\nSimplify unit tests with JUnit 5 and Apache Shiro.\n\n## Usage\n\n```java\n@ExtendWith(ShiroExtension.class)\n@SubjectAware(\n  value = \"trillian\", \n  roles = \"user\", \n  permissions = \"one:*\"\n)\nclass ShiroExtensionTest {\n\n  @Test\n  void shouldHavePreparedSubject() {\n    Subject subject = SecurityUtils.getSubject();\n    assertThat(subject.getPrincipal()).isEqualTo(\"trillian\");\n    assertThat(subject.hasRole(\"user\")).isTrue();\n    assertThat(subject.isPermitted(\"one:dot:one\")).isTrue();\n  }\n\n}\n```\n\nThe `SubjectAware` annotation can be placed on classes, nested classes or on methods.\nRoles and permissions are merged. If the `value` is of `SubjectAware` is empty, no subject is bound.\n\nFor more samples have a look at the [ShiroExtensionTest](lib/src/test/java/org/github/sdorra/jse/ShiroExtensionTest.java).\n\n## Installation\n\nGet the latest stable version from [![Maven Central](https://img.shields.io/maven-central/v/com.github.sdorra/junit-shiro-extension.svg)](https://search.maven.org/search?q=g:com.github.sdorra%20a:junit-shiro-extension)\n\n### Gradle\n\n```groovy\ntestImplementation 'com.github.sdorra:junit-shiro-extension:x.y.z'\n```\n\n### Maven\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.sdorra\u003c/groupId\u003e\n  \u003cartifactId\u003ejunit-shiro-extension\u003c/artifactId\u003e\n  \u003cversion\u003ex.y.z\u003c/version\u003e\n  \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdorra%2Fjunit-shiro-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdorra%2Fjunit-shiro-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdorra%2Fjunit-shiro-extension/lists"}