Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ taikai Public

Taikai is an extension of the popular ArchUnit library, offering a comprehensive suite of predefined rules tailored for various technologies.

License

Notifications You must be signed in to change notification settings

enofex/taikai

Repository files navigation

maven workflow

Taikai

Taikai is a wrapper around the awesome ArchUnit and provides a set of common rules for different technologies.

Maven Usage

<dependency>
  <groupId>com.enofex</groupId>
  <artifactId>taikai</artifactId>
  <version>${taikai.version}</version>
  <scope>test</scope>
</dependency>

The ${taikai.version} property should be defined as a property in your Maven project to specify the version. The library requires that the necessary dependencies are already declared.

JUnit 5 Example test

@Test
void shouldFulfilConstrains() {
  Taikai taikai = Taikai.builder()
      .namespace("com.enofex.taikai")
      .spring(spring -> spring
          .noAutowiredFields()
          .boot(boot -> boot
              .springBootApplicationShouldBeIn("com.enofex.taikai"))
          .configurations(configuration -> configuration
              .namesShouldEndWithConfiguration()
              .namesShouldMatch("regex"))
          .controllers(controllers -> controllers
              .shouldBeAnnotatedWithRestController()
              .namesShouldEndWithController()
              .namesShouldMatch("regex")
              .shouldNotDependOnOtherControllers()
              .shouldBePackagePrivate())
          .services(services -> services
              .shouldBeAnnotatedWithService()
              .namesShouldMatch("regex")
              .namesShouldEndWithService())
          .repositories(repositories -> repositories
              .shouldBeAnnotatedWithRepository()
              .namesShouldMatch("regex")
              .namesShouldEndWithRepository()))
      .test(test -> test
          .junit5(junit5 -> junit5
              .classesShouldNotBeAnnotatedWithDisabled()
              .methodsShouldNotBeAnnotatedWithDisabled()))
      .java(java -> java
          .imports(imports -> imports
              .shouldHaveNoCycles()
              .shouldNotImport("..shaded..")
              .shouldNotImport("org.junit.."))
          .naming(naming -> naming
              .classesShouldNotMatch(".*Impl")
              .interfacesShouldNotHavePrefixI()))
      .build();
}

User Guide

Please refer to the complete documentation for detailed information.

Contributing

If you want to contribute to this project, then follow please these instructions.

About

Taikai is an extension of the popular ArchUnit library, offering a comprehensive suite of predefined rules tailored for various technologies.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 7

Languages