
Public void = REPOSITORY_SNAPSHOTS, policy = RepositoryPolicyEnum.SNAPSHOT) Repository = ":snapshot-artifact") Path RepositoryManagementTestExecutionListener.class, ArtifactManagementTestExecutionListener.class }) Public class RepositoryManagementTestExecutionListener.class, ArtifactManagementTestExecutionListener.class }) Proxy repository support provided with annotation.

Layout = MavenArtifactCoordinates.LAYOUT_NAME) This annotation provides an isolated test repository which can be used as a sandbox for your test method. This requirement can be achieved using the annotation. Do not name test resources with common dummy names such as foo.txt, bar.zip, blah.jar and etc, as this might cause resource collisions and issues, in case someone else decided to use such a name (if you spot any such resources, please raise an issue/pull, as this is bad practice).Īs mentoned above every test should have isolated and self-sufficient resources.Every test case should generate all the resources it requires in each of its respective test methods.Test cases should be self-sufficient and not rely on data, or resources produced by other tests, or the outcome of other tests in any other way.

The naming convention for such repositories is as follows: given a class name of MavenMetadataForReleasesTest, the respective repository should be called mmfrt-releases.Tests that need to execute operations against a repository, should create the repository on the fly in order to guarantee test resource isolation.Don't use the REST API calls for testing your service class methods, test them directly using RestAssured.If you would like to have some initialization method with annotation, please make sure that you also invoke super.init() as a first line in such methods. Mark your test as and take a look at the existing examples (sub-classes of RestAssuredBaseTest). Don't try to re-invent the wheel and inherit all rest-assured initialization stuff from RestAssuredBaseTest. Use rest-assured for testing REST API.All tests MUST be idempotent, which means that we should be able to execute them multiple times from the console or an IDE and the outcome should not depend on how many times the test has been executed.If you need to create a repository for your test and it needs to use the Maven 2 Layout Provider, please make sure you're only enabling indexing, if really necessary, as this can be quite expensive in terms of resources.Pull requests will not be merged, if they mark tests as without prior explanation of the cause and approval from the reviewer/team.Pull requests will not be merged, if there are failing tests.If tests are failing, they are a top priority.

#KOTOR STRONGBOX CODE#
All code must be accompanied with sufficiently thorough test cases which validate the functionality.The only module allowed to use hamcrest for assertions is the strongbox-web-core, because the actual implementation of MockMvc allows only hamcrest in their API - see issue. For assertions, please use the AssertJ library.Use JUnit 5 as testing framework (both unit and integration tests).Where It Differs From Stock Version Of rest-assuredĭo I Need To Extend RestAssuredArtifactClient, Or Write My Own Methods In Unit Tests? Life Hacks To Make Artifacts Testing Easier

Building Strongbox using a Strongbox instanceĭeploy Test Artifacts Into Test Repository
