-
-
Notifications
You must be signed in to change notification settings - Fork 683
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 ConstructorAssert instead of using ClassAssert #1871
base: 3.x
Are you sure you want to change the base?
Conversation
} | ||
|
||
/** | ||
* Verifies that the actual {@code Constructor} is public (has {@code public} modifier). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assert is testing for private
modifier
* Verifies that the actual {@code Constructor} is public (has {@code public} modifier). | |
* Verifies that the actual {@code Constructor} is private (has {@code private} modifier). |
} | ||
|
||
/** | ||
* Verifies that the actual {@code Constructor} is public (has {@code public} modifier). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assert is testing for protected
modifier
* Verifies that the actual {@code Constructor} is public (has {@code public} modifier). | |
* Verifies that the actual {@code Constructor} is protected (has {@code protected} modifier). |
* } | ||
* | ||
* // these assertions succeed: | ||
* assertThat(String.class.getDeclaredConstructor()).isPrivate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* assertThat(String.class.getDeclaredConstructor()).isPrivate(); | |
* assertThat(MyClass.class.getDeclaredConstructor()).isPrivate(); |
* } | ||
* | ||
* // these assertions succeed: | ||
* assertThat(String.class.getDeclaredConstructor()).isProtected(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* assertThat(String.class.getDeclaredConstructor()).isProtected(); | |
* assertThat(MyClass.class.getDeclaredConstructor()).isProtected(); |
} | ||
|
||
/** | ||
* Verifies that the actual {@code Constructor} is public (has {@code public} modifier). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description does not describe the real checks
@@ -345,10 +345,11 @@ public SELF hasSameSizeAs(Iterable<?> other) { | |||
*/ | |||
@Override | |||
public SELF contains(@SuppressWarnings("unchecked") ELEMENT... values) { | |||
arrays.assertContains(info, actual, values); | |||
arrays.assertContains(info, actual, values); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra padding
return myself; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra padding
@@ -3160,4 +3161,7 @@ private SELF newObjectArrayAssert(List<ELEMENT> filteredList) { | |||
return filteredList.toArray(actualCopy); | |||
} | |||
|
|||
// public boolean hasPublicConstructor(List<ELEMENT> parameters){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't include not implemented parts in PR
} | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra padding
} | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra padding
@@ -586,6 +587,13 @@ public static ClassAssert assertThat(Class<?> actual) { | |||
return new ThrowableAssert(actual); | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add JavaDoc
@@ -586,6 +587,13 @@ public static ClassAssert assertThat(Class<?> actual) { | |||
return new ThrowableAssert(actual); | |||
} | |||
|
|||
|
|||
public static ConstructorAssert assertThat(Constructor actual){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add space before {
* @param actual the actual value. | ||
* @return the created assumption for assertion object. | ||
*/ | ||
public static AbstractConstructorAssert<ConstructorAssert,Constructor> assumeThat(Constructor actual) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add space after ,
@phx1999 can you remove all the xml files from the PR and address @valery1707 comments? thanks! |
38c7b4b
to
3cde5bf
Compare
301ca01
to
c730d18
Compare
Check List: