Skip to content

Commit f3fab5b

Browse files
committed
Update examples.yml
1 parent d8e3c22 commit f3fab5b

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

src/main/resources/META-INF/rewrite/examples.yml

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2960,14 +2960,23 @@ examples:
29602960
import org.junit.Rule
29612961
import org.junit.rules.TemporaryFolder
29622962
2963+
import java.io.File
2964+
import java.io.IOException
2965+
29632966
class AbstractIntegrationTest {
29642967
@TempDir
29652968
File temporaryFolder
29662969
29672970
def setup() {
29682971
projectDir = temporaryFolder.root
2969-
buildFile = File.createTempFile('build.gradle', null, temporaryFolder)
2970-
settingsFile = File.createTempFile('settings.gradle', null, temporaryFolder)
2972+
buildFile = newFile(temporaryFolder, 'build.gradle')
2973+
settingsFile = newFile(temporaryFolder, 'settings.gradle')
2974+
}
2975+
2976+
private static File newFile(File parent, String child) throws IOException {
2977+
File result = new File(parent, child)
2978+
result.createNewFile()
2979+
return result
29712980
}
29722981
}
29732982
language: groovy
@@ -3380,25 +3389,6 @@ examples:
33803389
type: specs.openrewrite.org/v1beta/example
33813390
recipeName: org.openrewrite.java.testing.mockito.Mockito1to5Migration
33823391
examples:
3383-
- description: ''
3384-
sources:
3385-
- before: |
3386-
<project>
3387-
<modelVersion>4.0.0</modelVersion>
3388-
<groupId>com.example</groupId>
3389-
<artifactId>demo</artifactId>
3390-
<version>0.0.1-SNAPSHOT</version>
3391-
<dependencies>
3392-
<dependency>
3393-
<groupId>org.mockito</groupId>
3394-
<artifactId>mockito-inline</artifactId>
3395-
<version>3.11.2</version>
3396-
<scope>test</scope>
3397-
</dependency>
3398-
</dependencies>
3399-
</project>
3400-
path: pom.xml
3401-
language: xml
34023392
- description: ''
34033393
sources:
34043394
- before: |
@@ -3434,6 +3424,25 @@ examples:
34343424
}
34353425
}
34363426
language: java
3427+
- description: ''
3428+
sources:
3429+
- before: |
3430+
<project>
3431+
<modelVersion>4.0.0</modelVersion>
3432+
<groupId>com.example</groupId>
3433+
<artifactId>demo</artifactId>
3434+
<version>0.0.1-SNAPSHOT</version>
3435+
<dependencies>
3436+
<dependency>
3437+
<groupId>org.mockito</groupId>
3438+
<artifactId>mockito-inline</artifactId>
3439+
<version>3.11.2</version>
3440+
<scope>test</scope>
3441+
</dependency>
3442+
</dependencies>
3443+
</project>
3444+
path: pom.xml
3445+
language: xml
34373446
---
34383447
type: specs.openrewrite.org/v1beta/example
34393448
recipeName: org.openrewrite.java.testing.mockito.MockitoBestPractices

0 commit comments

Comments
 (0)