Skip to content

fix description of targetOwner predicate#1579

Open
wakingrufus wants to merge 1 commit intoTNG:mainfrom
wakingrufus:fix-accessTarget
Open

fix description of targetOwner predicate#1579
wakingrufus wants to merge 1 commit intoTNG:mainfrom
wakingrufus:fix-accessTarget

Conversation

@wakingrufus
Copy link
Copy Markdown

@wakingrufus wakingrufus commented Jan 19, 2026

targetOwner was producing the same message as target() eg. "access target where target is annotated with..." instead of "access target where owner is annotated with..."

targetOwner was producing the same message as target() eg. "access target where target is annotated with..." instead of "access target where owner is annotated with..."

Signed-off-by: John Burns <wakingrufus@gmail.com>
Copy link
Copy Markdown

@StefanGraeber StefanGraeber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for localizing the incorrect message and creating a PR.
I prefer to generate target owner instead of just owner and also fix originOwner.

I created a modified PR: #1603

*/
package com.tngtech.archunit.core.domain;

import java.util.Collections;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix you code formatting as described in https://github.com/TNG/ArchUnit/blob/main/CONTRIBUTING.md#formatting

JavaAccess.Predicates.targetOwner(DescribedPredicate.<JavaClass>alwaysTrue().as("some text"));

assertThat(predicate)
.hasDescription("owner some text")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this text doesn't specify that the owner is related in any way to the target or any hint what is owned.
Is it the target owner or the origin owner?

I think the issue you are fixing here also exists for the origin(Owner) in exactly the same constellation.

The test also doesn't test that the correct object is passed to the nested predicate (which also not done by origin_predicate)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants