Skip to content

Commit 4e7e294

Browse files
committed
UnsupportedOperationException when creating 'scratch file' in IntelliJ IDEA
Signed-off-by: Dmytro Nosan <[email protected]>
1 parent e173541 commit 4e7e294

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-javaformat-intellij-idea/spring-javaformat-intellij-idea-plugin/src/test/java/io/spring/format/formatter/intellij/formatting/SpringJavaFormatFormattingServiceTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ void canFormatWhenJavaFileAndActiveReturnsTrue() {
8080
}
8181

8282
@Test
83-
void formatDocumentAppliesFormatting(@TempDir Path tempDir) throws Exception {
84-
Files.writeString(tempDir.resolve(".springjavaformatconfig"), "indentation-style=spaces");
83+
void formatDocumentAppliesFormatting(@TempDir Path projectDir) throws Exception {
84+
Files.writeString(projectDir.resolve(".springjavaformatconfig"), "indentation-style=spaces");
8585
Document document = mockDocument("public class Hello{"
8686
+ "\tpublic void hello() {"
8787
+ "\tString value =\t\"Hello World\";}}");
8888
FormattingContext formattingContext = mock(FormattingContext.class);
89-
VirtualFile virtualFile = new CoreLocalVirtualFile(new CoreLocalFileSystem(), tempDir.resolve("Hello.java"));
89+
VirtualFile virtualFile = new CoreLocalVirtualFile(new CoreLocalFileSystem(), projectDir.resolve("Hello.java"));
9090
given(formattingContext.getVirtualFile()).willReturn(virtualFile);
9191
this.service.formatDocument(document, Collections.emptyList(), formattingContext, false, false);
9292
assertThat(document.getText()).isEqualTo("public class Hello {\n\n"

0 commit comments

Comments
 (0)