Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Predicate-based DescribedPredicate Factory #188

Merged
merged 2 commits into from
Jul 4, 2019

Conversation

jzheaux
Copy link
Contributor

@jzheaux jzheaux commented Jun 27, 2019

Compose a DescribedPredicate from a Predicate and a description.

Signed-off-by: Josh Cummings josh.cummings@gmail.com

@jzheaux
Copy link
Contributor Author

jzheaux commented Jun 27, 2019

The error from Travis is:

Could not determine the dependencies of task ':archunit:shadowJar'.
> Could not resolve all dependencies for configuration ':archunit:runtimeClasspath'.
   > Could not resolve org.ow2.asm:asm:7.0.
     Required by:
         project :archunit
      > Could not resolve org.ow2.asm:asm:7.0.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm/7.0/asm-7.0.pom'.
            > Could not GET 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm/7.0/asm-7.0.pom'. Received status code 403 from server: Forbidden
   > Could not resolve org.slf4j:slf4j-api:1.7.25.
     Required by:
         project :archunit
      > Could not resolve org.slf4j:slf4j-api:1.7.25.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.pom'.
            > Could not GET 'https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.pom'. Received status code 403 from server: Forbidden

It's not clear to me if there is something I should do to repair the PR? I followed the steps listed in the contribution guildelines and got a green light locally.

@codecholeric
Copy link
Collaborator

Thanks for your contribution 😄 I think the Travis CI was just broken somehow, I restarted the build and this time it passed.
I'm wondering if you're very attached to the name when? Because I think I myself would rather look for a factory method DescribedPredicate.of(description, predicate) if I look at the rest of the API.
Or maybe DescribedPredicate.test(description, predicate).
when somehow doesn't trigger the association with a boolean predicate for me (rather reminds me of Mockito 😉).
What do you think?

@jzheaux
Copy link
Contributor Author

jzheaux commented Jul 1, 2019

@codecholeric I see your point about when, though of seems a bit semantically weak since it could apply to several of the other factory methods as well.

What about describe(description, predicate)? It's kind of the inverse of your test proposal, focusing on a description being added to a test, as opposed to a test being added to a description.

@codecholeric
Copy link
Collaborator

I like describe(description, predicate) 😄 I've thought about it and it makes complete sense to me, because it adds a description to an existing predicate.
Do you want to make that renaming? Then I'll immediately merge it!

Compose a DescribedPredicate from a Predicate and a description.

Signed-off-by: Josh Cummings <josh.cummings@gmail.com>
@jzheaux
Copy link
Contributor Author

jzheaux commented Jul 3, 2019

Excellent! I've updated the method name to describe, @codecholeric.

Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
@codecholeric codecholeric merged commit b3ab029 into TNG:master Jul 4, 2019
@codecholeric
Copy link
Collaborator

Okay, done, thanks a lot for the initiative and your contribution 😃 I really appreciate it!

@jzheaux jzheaux deleted the add-when branch July 9, 2019 11:59
codecholeric added a commit that referenced this pull request Feb 21, 2021
Add Predicate-based DescribedPredicate Factory
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