ArchUnit alternatives and similar libraries
Based on the "Testing" category.
Alternatively, view ArchUnit alternatives based on common mentions on social networks and blogs.
-
Mockito
Most popular Mocking framework for unit tests written in Java -
Apache JMeter
Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services -
TestContainers
Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container. -
MockServer
MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby. MockServer also includes a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). -
PowerMock
PowerMock is a Java framework that allows you to unit test code normally regarded as untestable. -
Awaitility
Awaitility is a small Java DSL for synchronizing asynchronous operations -
AssertJ
AssertJ is a library providing easy to use rich typed assertions -
Pact JVM
JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project. -
JSONAssert
Write JSON unit tests in less code. Great for testing REST interfaces. -
JMockit
Advanced Java library for integration testing, mocking, faking, and code coverage -
Citrus
Framework for automated integration tests with focus on messaging integration -
System Rules
A collection of JUnit rules for testing code which uses java.lang.System. -
junit-dataprovider
A TestNG like dataprovider runner for JUnit with many additional features -
ConcurrentUnit
Toolkit for testing multi-threaded and asynchronous applications -
Mutability Detector
Lightweight analysis tool for detecting mutability in Java classes -
Jukito
The combined power of JUnit, Guice and Mockito. Plus it sounds like a cool martial art. -
Lamdba Behave
A modern testing and behavioural specification framework for Java 8 -
Arquillian
Integration and functional testing platform for Java EE containers. -
Randomized Testing
Randomized Testing (Core JUnit Runner, ANT, Maven) -
Spectrum
A BDD-style test runner for Java 8. Inspired by Jasmine, RSpec, and Cucumber. -
Scott Test Reporter
Never debug a test again: Detailed failure reports and hassle free assertions for Java tests - Power Asserts for Java -
pojo-tester
Java testing framework for testing pojo methods. It tests equals, hashCode, toString, getters, setters, constructors and whatever you report in issues ;) -
raml-tester
Test if a request/response matches a given raml definition
Updating dependencies is time-consuming.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of ArchUnit or a related project?
README
ArchUnit is a free, simple and extensible library for checking the architecture of your Java code. That is, ArchUnit can check dependencies between packages and classes, layers and slices, check for cyclic dependencies and more. It does so by analyzing given Java bytecode, importing all classes into a Java code structure. ArchUnit's main focus is to automatically test architecture and coding rules, using any plain Java unit testing framework.
An Example
Add the Maven Central dependency to your project
Gradle
testImplementation 'com.tngtech.archunit:archunit:1.0.1'
Maven
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit</artifactId>
<version>1.0.1</version>
<scope>test</scope>
</dependency>
Create a test
import com.tngtech.archunit.core.domain.JavaClasses;
import com.tngtech.archunit.core.importer.ClassFileImporter;
import com.tngtech.archunit.lang.ArchRule;
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
public class MyArchitectureTest {
@Test
public void some_architecture_rule() {
JavaClasses importedClasses = new ClassFileImporter().importPackages("com.myapp");
ArchRule rule = classes()... // see next section
rule.check(importedClasses);
}
}
Let the API guide you
[ArchUnit Fluent API](ArchUnit-API.gif)
Where to look next
For further information, check out the user guide at http://archunit.org or test examples for the current release at ArchUnit Examples.
License
ArchUnit is published under the Apache License 2.0, see http://www.apache.org/licenses/LICENSE-2.0 for details.
It redistributes some third party libraries:
- ASM (http://asm.ow2.org), under BSD Licence
- Google Guava (https://github.com/google/guava), under Apache License 2.0
All licenses for ArchUnit and redistributed libraries can be found within the [licenses](licenses) folder.
*Note that all licence references and agreements mentioned in the ArchUnit README section above
are relevant to that project's source code only.