npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

aem-junit-skill

v1.1.0

Published

AEM JUnit Testing skill for AI assistants - Comprehensive guide for testing Adobe Experience Manager with JUnit

Readme

AEM JUnit Testing Skill

Comprehensive JUnit testing guide for Adobe Experience Manager (AEM) as a Cloud Service. Designed for AI assistants to generate accurate, production-ready test code.

Overview

This skill provides comprehensive documentation and templates for writing JUnit tests in AEM projects using wcm.io AEM Mocks, Apache Sling Mocks, and Adobe Testing Clients.

Features

  • 📚 2,200+ lines of documentation
  • 🎯 22 testing scenarios covered
  • 9 CLI commands for quick reference
  • Working example projects with tests
  • 🔧 Platform integrations (Claude, Cursor, Copilot, Codex)

Quick Start

Using npx (No Install)

# Show help
npx aem-junit-skill help

# Show full guide
npx aem-junit-skill guide

# Get Maven dependencies
npx aem-junit-skill deps

# Generate test template
npx aem-junit-skill template model
npx aem-junit-skill template service
npx aem-junit-skill template component
npx aem-junit-skill template servlet

Clone & Install

git clone https://github.com/narendragandhi/aem-junit-skill
cd aem-junit-skill
npm install -g
aem-junit-skill help

What's Covered

Testing Scenarios

| Scenario | Status | |----------|--------| | Sling Models (basic & advanced) | ✅ | | OSGi Services | ✅ | | Pages & Components | ✅ | | DAM Assets | ✅ | | Servlets | ✅ | | Workflows | ✅ | | Schedulers | ✅ | | Event Handlers | ✅ | | QueryBuilder | ✅ | | Content Fragments | ✅ | | Context-Aware Configs | ✅ | | Users, Groups & ACLs | ✅ |

Advanced Sling Model Annotations

  • @ValueMapValue
  • @ChildResource
  • @Self
  • @Named
  • @Optional
  • defaultValue
  • @OSGiService
  • DefaultInjectionStrategy

Documentation Structure

aem-junit-skill/
├── SKILL.md                    # Main documentation (2,230 lines)
├── QUALITY_METRICS.md          # Quality metrics & coverage
├── PROMPT_TESTS.md             # Test prompts for AI evaluation
├── bin/
│   └── run.js                  # CLI tool
├── skills/
│   └── aem-junit/
│       └── SKILL.md           # Primary skill file
├── docs/
│   └── references/
│       └── testing-api-reference.md
├── examples/
│   └── aem-test-verified/     # Working Maven project
├── .github/
│   └── workflows/
│       └── ci.yml            # GitHub Actions
└── package.json

Dependencies

<properties>
    <aem.sdk.api>2025.11.23482.20251120T200914Z-251200</aem.sdk.api>
    <aem-mock.version>5.6.4</aem-mock.version>
    <junit.version>5.11.0</junit.version>
    <mockito.version>5.14.0</mockito.version>
</properties>

Installation by Platform

Claude Code

Option 1: Project-level (recommended)

# In your AEM project root
mkdir -p .claude/skills
curl -o .claude/skills/aem-junit.md https://raw.githubusercontent.com/narendragandhi/aem-junit-skill/main/skills/aem-junit/SKILL.md

Option 2: Using npx

npx aem-junit-skill guide > .claude/skills/aem-junit.md

Option 3: Global installation

mkdir -p ~/.claude/skills
curl -o ~/.claude/skills/aem-junit.md https://raw.githubusercontent.com/narendragandhi/aem-junit-skill/main/skills/aem-junit/SKILL.md

Cursor AI

Option 1: Copy rules file

curl -o .cursorrules https://raw.githubusercontent.com/narendragandhi/aem-junit-skill/main/.cursorrules

Option 2: Create .cursor/rules directory

mkdir -p .cursor/rules
curl -o .cursor/rules/aem-junit.mdc https://raw.githubusercontent.com/narendragandhi/aem-junit-skill/main/.cursorrules

GitHub Copilot

mkdir -p .github
curl -o .github/copilot-instructions.md https://raw.githubusercontent.com/narendragandhi/aem-junit-skill/main/.github/copilot-instructions.md

Or append to existing instructions:

curl https://raw.githubusercontent.com/narendragandhi/aem-junit-skill/main/.github/copilot-instructions.md >> .github/copilot-instructions.md

Google Gemini CLI

curl -o GEMINI.md https://raw.githubusercontent.com/narendragandhi/aem-junit-skill/main/AGENTS.md

Windsurf / Cascade

mkdir -p .windsurf/rules
curl -o .windsurf/rules/aem-junit.md https://raw.githubusercontent.com/narendragandhi/aem-junit-skill/main/skills/aem-junit/SKILL.md

OpenAI Codex / Other Agents

Use the AGENTS.md file which provides a condensed version of the skill:

curl -o AGENTS.md https://raw.githubusercontent.com/narendragandhi/aem-junit-skill/main/AGENTS.md

Example Test

@ExtendWith(AemContextExtension.class)
class ArticleModelTest {

    private final AemContext context = new AemContext();

    @BeforeEach
    void setUp() {
        context.load().json("/test-content.json", "/content/mysite");
        context.addModelsForClasses(ArticleModel.class);
    }

    @Test
    void testArticleModel() {
        Resource resource = context.resourceResolver().getResource("/content/mysite/article");
        ModelFactory modelFactory = context.getService(ModelFactory.class);
        ArticleModel model = modelFactory.createModel(resource, ArticleModel.class);
        
        assertNotNull(model);
        assertEquals("Test Title", model.getTitle());
    }
}

Testing the Examples

cd examples/aem-test-verified
mvn test

Expected output:

Tests run: 20, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS

Example Tests Included

| Test Class | Tests | Patterns Covered | |------------|-------|------------------| | HeroComponentTest | 2 | Basic Sling Model | | HelloServiceTest | 4 | OSGi Service, Mockito | | NavigationModelTest | 4 | @Self, @ChildResource | | SiteConfigTest | 4 | Context-Aware Config | | AssetApprovalProcessTest | 6 | Workflow, WorkItem mocking |

Contributing

See CONTRIBUTING.md for:

  • Development setup
  • Adding new examples
  • Code style guidelines
  • Testing procedures

License

Apache License 2.0 - See LICENSE