Skip to content

Commit

Permalink
Merge branch 'main' into bugfix/cope_with_redundant_modifier_this_bef…
Browse files Browse the repository at this point in the history
…ore_identifier
  • Loading branch information
yurii-yu authored Oct 7, 2024
2 parents e0a06f5 + 058d2ff commit 2137491
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dependencies {

annotationProcessor("org.openrewrite:rewrite-templating:${rewriteVersion}")
implementation("org.openrewrite:rewrite-templating:${rewriteVersion}")
compileOnly("com.google.errorprone:error_prone_core:2.19.1:with-dependencies") {
compileOnly("com.google.errorprone:error_prone_core:2.+:with-dependencies") {
exclude("com.google.auto.service", "auto-service-annotations")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx)

if (MOCKED_STATIC_MATCHER.matches(mi)) {
determineTestGroups();
if (!getCursor().getPath(o -> o instanceof J.Assignment || o instanceof J.Try.Resource).hasNext()) {
if (!getCursor().getPath(o -> o instanceof J.VariableDeclarations ||
o instanceof J.Assignment ||
o instanceof J.Try.Resource).hasNext()) {
//noinspection DataFlowIssue
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,25 @@ public void testStaticMethod() {
);
}

@Test
@Issue("https://github.com/openrewrite/rewrite-testing-frameworks/issues/611")
void existingMockitoMockStaticShouldNotBeTouched() {
//language=java
rewriteRun(
java(
"""
import static org.mockito.Mockito.mockStatic;
import org.mockito.MockedStatic;
class TestClass {
MockedStatic<String> mocked = mockStatic(String.class);
}
"""
)
);
}

@Test
@Issue("https://github.com/openrewrite/rewrite-testing-frameworks/issues/358")
void doesNotExplodeOnTopLevelMethodDeclaration() {
Expand Down
8 changes: 8 additions & 0 deletions suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
<suppress until="2024-11-25Z">
<notes><![CDATA[
file name: rewrite-testing-frameworks-2.20.0-SNAPSHOT.jar: wiremock-jre8-2.35.0.jar: swagger-ui-bundle.js
false positive: js library that is shipped as part of this jar
]]></notes>
<packageUrl regex="true">^pkg:javascript/DOMPurify@.*$</packageUrl>
<vulnerabilityName>CVE-2024-45801</vulnerabilityName>
</suppress>
</suppressions>

0 comments on commit 2137491

Please sign in to comment.