chrisly42
9b25e50183
Improvements for TwistedAssertionInspection to no longer report .class types as constant to bother, nor matches() and doesNotMatch() for regexps. If both sides are constants, they will only show as weak problems.
2020-02-17 20:17:33 +01:00
chrisly42
e8ce8ce2c6
BogusAssertionInspection will no longer warn if the expression contains method calls and now tries to avoid valid hashCode() and equals() tests.
2020-02-17 18:33:11 +01:00
chrisly42
62f59b0fe2
Added new TwistedAssertion inspection that will warn about assertions with the actual expression being a constant indicating swapped use of actual and expected expressions.
...
Added new BogusAssertion inspection that showing typical copy and paste errors where actual and expected expressions are the same.
2020-02-14 13:36:04 +01:00
chrisly42
58298fabc6
Extended Testing-Framework to work around IntelliJ IDEA introducing an unwanted assertj-core dependency conflicting with our newer one.
2020-02-08 16:33:38 +01:00
chrisly42
77d3608fd3
Minor NPE Bugfix. Fixed use of "experimental API". Upgraded dependencies.
2020-02-04 20:01:05 +01:00
chrisly42
a0909d8c39
Prepared release.
2019-11-19 19:47:40 +01:00
chrisly42
5113cc15ab
Added hasSize(), isEmpty() and isNotEmpty() for AssertThatFileExpression when using AssertJ >= 3.14.0.
2019-11-18 21:13:30 +01:00
chrisly42
ae2076a425
Bumped to AssertJ 3.14.0, AssertJ-Guava 3.3.0, Kotlin 1.3.60. IntelliJ-Plugin 0.4.13, Jacoco 0.8.5
2019-11-18 21:10:45 +01:00
chrisly42
42429c0f72
Added AssertThatComparableExpression for funny compareTo() uses.
2019-11-17 21:21:45 +01:00
chrisly42
8133f3850f
Added first version of AssertThatPathExpression for a limited number transformations (more stuff is possible, but requires detection and transformation of static Files-methods).
2019-11-17 19:10:41 +01:00
chrisly42
8d03b3734c
Fixed a lapsuus in AssertThatFileExpression also transforming listFiles() with a filter argument.
2019-11-17 17:14:28 +01:00
chrisly42
2f0d855d1e
Minor documentation fixes. Prepared release.
2019-09-30 22:17:23 +02:00
chrisly42
6dab8ad552
Added several transformations to AssertThatStringExpression inspection. Specifically, uses of matches(), compareToIgnoreCase(), indexOf(), and trim().
2019-09-30 20:27:43 +02:00
chrisly42
1983750077
Internal refactoring: Reduced code duplication by moving stuff into a common base class.
2019-09-30 17:25:16 +02:00
chrisly42
a0ed4eab76
Added new AssertThatFileExpression to move out many common methods from inside the assertThat() expression (exists(), getName(), getParent(), and many more).
2019-09-29 21:56:36 +02:00
chrisly42
acc81863f5
Fixed a bug in AssertThatBinaryExpression inspection for assertThat(null != expression) and related that would not correctly invert the condition on transformation.
2019-09-29 12:32:32 +02:00
chrisly42
2b97494c17
Really fixed AssertThatGuavaOptional inspections to avoid conversions from .get() to .contains() for array types.
2019-09-25 18:38:35 +02:00
chrisly42
e3444db213
Fixes to AssertThatSize inspection after extending it for Maps in previous release as not all combinations for .hasSameSizeAs() are supported.
...
Bumped to IntelliJ IDEA 2019.2.3.
2019-09-24 22:55:02 +02:00
chrisly42
855fb03f7c
One more option for AssertThatCollectionOrMap inspection for warnings without quickfix.
...
AssertThatGuavaOptional inspections will now avoid conversions from .get() to .contains() for array types (currently not correctly supported by AssertJ-Guava).
2019-09-24 22:16:11 +02:00
chrisly42
8d678411b5
Fix for AssertThatCollectionOrMap inspection sometimes causing an index out of bounds exception.
...
Added an settings option for AssertThatCollectionOrMap inspection respecting the degenerated case of maps with null values.
Upgrade to JUnit Jupiter 5.5.2.
2019-09-09 23:13:45 +02:00
chrisly42
341d1877df
Prepared for 1.4 release.
2019-08-25 18:40:58 +02:00
chrisly42
05dc4905ca
Extended AssertThatCollectionOrMap inspection for several assertThat(map.get()) cases as suggested by Stefan H.
2019-08-23 19:58:11 +02:00
chrisly42
315b93d90d
Extended AssertThatSize inspection to Maps, too.
2019-08-23 18:21:08 +02:00
chrisly42
36f63d26d2
Minor fix for highlighting of JoinVarArgsContains inspection.
...
Upgraded to kotlin 1.3.50, intellij plugin 0.4.10, assertj 3.13.2, idea 2019.2.1
2019-08-23 18:04:07 +02:00
chrisly42
a4535afbbb
Fixed references to wrong AssertJ version 13.2.0 instead of 3.12.0, courtesy of Bernhard R.
2019-08-04 18:29:59 +02:00
chrisly42
df11939589
New JoinVarArgsContains inspection that will detect multiple .contains(), .doesNotContain(), and .containsOnlyOnce() calls within the same statement that could be joined together using variadic arguments.
2019-08-03 20:57:34 +02:00
chrisly42
4420a0a392
AssertThatJava8Optional and AssertThatGuavaOptional inspections do not longer try to fix assertThat(optional).isEqualTo(Optional.fromNullable(expression)) to contains() when expression is not a non-null constant expression.
2019-07-30 20:02:40 +02:00
chrisly42
8fb3ecce95
Bumped kotlin to 1.3.41, jupiter 5.5.1, added compatibility with IDEA 2019.2 and fixed regressions with new AssertJ 3.13.0.
2019-07-30 19:43:40 +02:00
chrisly42
5048c898ec
Fixed broken code in test classes (missing imports, undefined variables).
2019-07-30 19:39:16 +02:00
chrisly42
b84a781134
Reverted removed method (identical to default implementation) that causes compatibility problem with older IDEA versions (again, sigh)...
2019-06-23 19:24:36 +02:00
chrisly42
095345a456
The JoinAssertThatStatements inspection will now add line breaks on joining statements.
...
Unrelated: Upgraded Gradle to 5.4.1. Upgraded kotlin to 1.3.40. Upgraded jacoco to 0.8.4. Minor style change for immediate returns. Increased test/branch coverage.
2019-06-23 18:51:12 +02:00
chrisly42
5c455c3ca9
Fix for multiple JUnit Conversions in batch mode with and without delta creating an exception.
...
Added new AssertThatObjectExpression inspection for toString() and hashCode() and moved equals() from AssertThatBinaryExpression there.
2019-06-09 21:35:23 +02:00
chrisly42
6795622202
Finally was able to remove JUnit workaround for test invokation with availability of JUnit 5.5.0-RC1.
2019-06-09 14:17:44 +02:00
chrisly42
828e61a73b
New ImplicitAssertion inspection for implicit isNotNull(), isNotEmpty() and isPresent() assertions that will be covered by chained assertions.
2019-06-09 14:04:01 +02:00
chrisly42
178b7d368a
Extended JUnitAssertToAssertJ inspection to convert JUnit assume-Statements, too.
...
Improved JUnitAssertToAssertJ quick fix to swap expected and actual expressions if the actual one is a constant.
2019-05-17 12:17:01 +02:00
chrisly42
e797dc2515
Extended documentation about assumeThat() preconditions.
2019-05-16 20:06:14 +02:00
chrisly42
7133c55710
Added Guava Optional opt.orNull() == null case. Added Java 8 Optional opt.orElse(null) == null case, too.
2019-05-15 20:50:30 +02:00
chrisly42
94c695617a
Improved JoinAssertThatStatements detection of expressions with side-effects and added pre/post-increment/decrement detection.
2019-05-11 13:40:37 +02:00
chrisly42
ecb5029154
Fixed a NPE in AssumeThatInsteadOfReturn inspection quickfix for empty else branches.
...
Fixed missing description for AssumeThatInsteadOfReturn inspection.
Added new AssertThatCollectionOrMapExpression inspection that tries to pull out methods such as isEmpty() or contains() out of an actual assertThat() expression. Added more method calls that are considered extension points.
2019-05-06 20:17:11 +02:00
chrisly42
0e2007641c
Compatibility fixes for IDEA <= 2019.1 :-/
2019-05-05 20:06:12 +02:00
chrisly42
eab50f590b
Added a first version of a new inspection that tries to detect bogus uses of return statements in test methods and replaces them by assumeThat() calls. Removed oraclejdk8 from travis-ci. Added custom Jupiter DisplayNameGenerator for user friendly test names in report. Extended documentation. Removed Playground.
2019-05-05 19:02:35 +02:00
chrisly42
66f1467b23
Added coveralls.
2019-05-04 16:40:05 +02:00
chrisly42
6a36294a2b
Added travis Build Status to readme.
2019-05-04 16:15:36 +02:00
chrisly42
0b79a6d7dc
Added early bail-outs via simple text matchings to optimize speed of false positive detection.
2019-05-04 15:54:27 +02:00
chrisly42
6fb23ea89c
Heavily reworked inspections for edge cases, such as multiple isEqualTo() calls inside a single statement. Corrected highlighting for most inspections. Lots of refactorings, tweakings. Added travis-ci file (untested). Added jacoco.
2019-05-04 15:36:04 +02:00
chrisly42
362c4210a5
Fixed isEmpty() for enumerables and strings and isNull() for object conversions to be applied only if it is the terminal method call as isEmpty() and isNull() return void.
2019-05-01 13:15:31 +02:00
chrisly42
e55acf9c74
Extended test cases for AssertThatBooleanCondition and AssertThatObjectIsNullOrNotNull.
2019-04-29 20:10:55 +02:00
chrisly42
3ece81b024
Minor fixes to descriptions.
2019-04-29 19:58:05 +02:00
chrisly42
0b2ce470db
Fixed missing description for JoinAssertThatStatements and detection of equivalent expressions.
2019-04-29 19:58:00 +02:00
chrisly42
941ddfdb5e
Implemented first version of JoinAssertThatStatements inspection that will try to merge assertThat() statements with the same actual object together, preserving comments.
2019-04-28 20:43:42 +02:00
chrisly42
666e373405
Extended AssertThatSize inspection to transform hasSize() into hasSameSizeAs(), if possible.
2019-04-23 20:16:43 +02:00
chrisly42
8b0da63f86
Another fix for AssertThatGuavaOptional inspection regarding using the same family name for slightly different quick fix executions (really, Jetbrains, this sucks for no reason). Consolidated location of methods.
2019-04-23 18:19:47 +02:00
chrisly42
66508ceb2c
New AssertThatInstanceOf inspection that moves instanceof expressions out of assertThat(). Fixes to documentation.
2019-04-22 19:03:59 +02:00
chrisly42
db02f7fb93
New AssertThatInvertedBooleanCondition inspection that will remove inverted boolean expressions inside assertThat().
...
Renamed a few inspections to better/shorter names (and fixed file and directory names accordingly).
2019-04-20 18:40:38 +02:00
chrisly42
a707eee9ad
Extended AssertThatSize intention to take strings and CharSequences into account, too.
2019-04-20 09:04:38 +02:00
chrisly42
533c20906a
Added a note on referencing. Moved AssertThatStringExpression to a more appropriate place in documentation.
2019-04-19 19:44:40 +02:00
chrisly42
da83f7f101
New AssertThatStringExpression that will move isEmpty(), equals(), equalsIgnoreCase(), contains(), startsWith(), and endsWith() out of actual expression. Bumped intellij-plugin to latest version.
2019-04-19 19:33:14 +02:00
chrisly42
faeb509797
Fixed default method not available in IDEA <2018.3. Sigh :-(
2019-04-18 22:29:30 +02:00
chrisly42
9f91fb3ccf
Added support for referencing and refactoring inside ``.extracting()`` methods with fields, properties and methods (though getter renaming does not work that perfect, but I'm giving up for now as the IntelliJ SDK docs are seriously lacking).
...
Fixed an exception in batch mode if the description string was the same but for different fixes. Now descriptions are different for quick fixes triggered by AssertThatJava8OptionalInspection and AssertThatGuavaOptionalInspection. Minor refactorings. Extended documentation.
2019-04-18 22:12:48 +02:00
chrisly42
b58d8cfd2f
Fix for incompatible method call regarding IDEA <2018.2.
...
Heavy refactoring regarding quick fixes (using more extensions).
Even more refactoring.
Fixed/extended AssertThatGuavaOptionalInspection regarding static.
imports and wrong reference to core assertThat() where Guava assertThat() actually was necessary.
2019-04-13 18:35:49 +02:00
chrisly42
4e6d53b3dc
Reduced minimal supported IDEA version from 2018.2 to 2017.2.
...
Added AssertThatGuavaOptional inspection. Prepared next release.
Bumped to Kotlin 1.3.30.
2019-04-11 23:55:35 +02:00
chrisly42
2cdc242125
Refactored Code to avoid string duplications... added Boolean.map() extension.
2019-04-11 21:09:10 +02:00
chrisly42
d49b7bf17b
Optimized even more code. Fixed BinaryExpression for Boolean.TRUE/FALSE. Added new AssertThatJava8Optional inspection. Added changelog to README.
2019-04-11 16:26:11 +02:00
chrisly42
c1d8ade7b1
Optimized code. More kotlin-style stuff. Made detecting of Boolean.TRUE/FALSE available to all constant evaluations.
2019-04-08 11:56:13 +02:00
chrisly42
bdabcc7255
Removed TODO about AssertThatBinaryExpressionIsTrueOrFalse.
2019-04-07 11:37:10 +02:00
chrisly42
5812e72227
New inspection AssertThatBinaryExpressionIsTrueOrFalse that will find and fix common binary expressions and equals() statements (more than 150 combinations) inside assertThat().
2019-04-07 11:29:07 +02:00
chrisly42
6a44237ca0
Added tacky icon.
2019-04-06 21:29:18 +02:00
chrisly42
51703e8499
Merged AssertThatObjectIsNull and AssertThatObjectIsNotNull to AssertThatObjectIsNullOrNotNull.
...
Extended tests to be more explicit regarding the expected quick fix messages.
2019-04-06 21:29:18 +02:00
chrisly42
ba56325299
Internally: Upgraded to AssertJ 13.2.2.
...
Support for hasSizeLessThan(), hasSizeLessThanOrEqualTo(), hasSizeGreaterThanOrEqualTo(), and hasSizeGreaterThan() for AssertThatSizeInspection (with AssertJ >=13.2.0).
Really fixed highlighting for JUnit conversion. Sorry.
Fixed testing code to work against IDEA 2019.1.
2019-04-06 21:29:13 +02:00
chrisly42
5d91eaf276
Fixed descriptions and quick fix texts. Fixed highlighting of found problems and also 'Run inspection by Name' returning nothing.
2019-04-01 16:44:52 +02:00
chrisly42
78ad242b43
Added licence. Fixed descriptions.
2019-03-31 21:55:49 +02:00
chrisly42
8a246c1319
Implemented AssertThatSizeInspection.
2019-03-31 20:44:52 +02:00
chrisly42
847e46c217
Implemented JUnitAssertToAssertJInspection. More refactorings. Doc fixes.
2019-03-31 15:15:06 +02:00
chrisly42
582e254195
Implemented AssertThatEnumerableIsEmptyInspection. Improved literal values by constant value calculation, more refactoring.
2019-03-24 14:42:02 +01:00
chrisly42
e2ffce753c
Another fix for AssertThatStringIsEmpty, added support for CharSequences, added hasSize(0) case, refactored stuff. Added missing html.
2019-03-24 13:03:53 +01:00
chrisly42
458542de7c
Fix for AssertThatStringIsEmpty, refactored method.
2019-03-24 11:37:46 +01:00
chrisly42
5fa61a3004
Implemented AssertThatStringIsEmpty.
2019-03-24 09:15:07 +01:00
chrisly42
8051511524
Implemented AssertThatBooleanIsTrueOrFalseInspection.
2019-03-23 22:44:22 +01:00
chrisly42
80104004d0
Initial check-in with two inspections working.
2019-03-10 18:19:46 +01:00