Search in sources :

Example 1 with SourceBasedArtifactRelationshipDescriptor

use of org.archifacts.core.descriptor.SourceBasedArtifactRelationshipDescriptor in project archifacts by archifacts.

the class AxonDescriptorsTest method assertThat_source_based_artifact_relationship_descriptor_are_recognized.

@ParameterizedTest
@MethodSource("getSourceBasedArtifactRelationshipDescriptors")
void assertThat_source_based_artifact_relationship_descriptor_are_recognized(final SourceBasedArtifactRelationshipDescriptor sourceBasedArtifactRelationshipDescriptor, final Tuple... expectedTuples) {
    final Application application = Application.builder().descriptor(sourceBasedArtifactRelationshipDescriptor).buildApplication(DOMAIN);
    assertThat(application.getRelationshipsOfRole(sourceBasedArtifactRelationshipDescriptor.role())).extracting(r -> r.getSource().getJavaClass().reflect(), r -> r.getTarget().getJavaClass().reflect()).containsExactlyInAnyOrder(expectedTuples);
}
Also used : Arrays(java.util.Arrays) ReplaceUnderscores(org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores) ClassFileImporter(com.tngtech.archunit.core.importer.ClassFileImporter) MyAggregateRootId(org.archifacts.integration.axon.domain.MyAggregateRootId) MyEvent2(org.archifacts.integration.axon.domain.MyEvent2) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) MySagaEventHandler(org.archifacts.integration.axon.domain.MySagaEventHandler) MethodSource(org.junit.jupiter.params.provider.MethodSource) MyQuery1(org.archifacts.integration.axon.domain.MyQuery1) JavaClasses(com.tngtech.archunit.core.domain.JavaClasses) Tuple(org.assertj.core.groups.Tuple) SourceBasedArtifactRelationshipDescriptor(org.archifacts.core.descriptor.SourceBasedArtifactRelationshipDescriptor) MyQuery2(org.archifacts.integration.axon.domain.MyQuery2) Assertions.tuple(org.assertj.core.api.Assertions.tuple) DisplayNameGeneration(org.junit.jupiter.api.DisplayNameGeneration) Set(java.util.Set) Arguments(org.junit.jupiter.params.provider.Arguments) Collectors(java.util.stream.Collectors) MyAggregateMember3(org.archifacts.integration.axon.domain.MyAggregateMember3) Application(org.archifacts.core.model.Application) MyAggregateMember2(org.archifacts.integration.axon.domain.MyAggregateMember2) MyCommand1(org.archifacts.integration.axon.domain.MyCommand1) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Stream(java.util.stream.Stream) MyAggregateMember1(org.archifacts.integration.axon.domain.MyAggregateMember1) MyCommand2(org.archifacts.integration.axon.domain.MyCommand2) BuildingBlockDescriptor(org.archifacts.core.descriptor.BuildingBlockDescriptor) MyAggregateRoot(org.archifacts.integration.axon.domain.MyAggregateRoot) MyEventHandler(org.archifacts.integration.axon.domain.MyEventHandler) MyEvent1(org.archifacts.integration.axon.domain.MyEvent1) MySaga(org.archifacts.integration.axon.domain.MySaga) MyQueryHandler(org.archifacts.integration.axon.domain.MyQueryHandler) Application(org.archifacts.core.model.Application) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

JavaClasses (com.tngtech.archunit.core.domain.JavaClasses)1 ClassFileImporter (com.tngtech.archunit.core.importer.ClassFileImporter)1 Arrays (java.util.Arrays)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 BuildingBlockDescriptor (org.archifacts.core.descriptor.BuildingBlockDescriptor)1 SourceBasedArtifactRelationshipDescriptor (org.archifacts.core.descriptor.SourceBasedArtifactRelationshipDescriptor)1 Application (org.archifacts.core.model.Application)1 MyAggregateMember1 (org.archifacts.integration.axon.domain.MyAggregateMember1)1 MyAggregateMember2 (org.archifacts.integration.axon.domain.MyAggregateMember2)1 MyAggregateMember3 (org.archifacts.integration.axon.domain.MyAggregateMember3)1 MyAggregateRoot (org.archifacts.integration.axon.domain.MyAggregateRoot)1 MyAggregateRootId (org.archifacts.integration.axon.domain.MyAggregateRootId)1 MyCommand1 (org.archifacts.integration.axon.domain.MyCommand1)1 MyCommand2 (org.archifacts.integration.axon.domain.MyCommand2)1 MyEvent1 (org.archifacts.integration.axon.domain.MyEvent1)1 MyEvent2 (org.archifacts.integration.axon.domain.MyEvent2)1 MyEventHandler (org.archifacts.integration.axon.domain.MyEventHandler)1 MyQuery1 (org.archifacts.integration.axon.domain.MyQuery1)1