Registry / testing / org-apache-sling-testing-osgi-mock-junit4

org-apache-sling-testing-osgi-mock-junit4

JSON →
library3.5.8javamavenunverified

Mock implementation of selected OSGi APIs for unit testing in JUnit 4.

<dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.testing.osgi-mock.junit4</artifactId> <version>3.5.8</version> </dependency>
INSTALL
IMPORT
SIG · ORG-APACHE-SLING-T
O
org-apache-sling-testing-osgi-mock-junit4
testingjavav3.5.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OsgiContext
org.apache.sling.testing.mock.osgi.junit4.OsgiContext

Sets up an OSGi mock context for unit testing.

import org.apache.sling.testing.mock.osgi.junit4.OsgiContext; import org.junit.Rule; import org.junit.Test; public class Quickstart { @Rule public OsgiContext context = new OsgiContext(); @Test public void testService() { context.registerService(String.class, "test"); String service = context.getService(String.class); System.out.println("Service: " + service); } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
3.5.8latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
org-apache-sling-testing-osgi-mock-junit4 — mvn dependency:get org-apache-sling-testing-osgi-mock-junit4 · libregistry