Skip to content

Commit 374acb6

Browse files
committed
Fix unitTests
1 parent cfd07b0 commit 374acb6

File tree

5 files changed

+37
-76
lines changed

5 files changed

+37
-76
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ lib('java.PalantirJavaFormatStep') +'{{yes}} | {{yes}}
8484
lib('java.RemoveUnusedImportsStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
8585
extra('java.EclipseJdtFormatterStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
8686
lib('java.FormatAnnotationsStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
87-
lib('java.CleanthatJavaStep') +'{{no}} | {{yes}} | {{no}} | {{no}} |',
87+
lib('java.CleanthatJavaStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
8888
lib('json.gson.GsonStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
8989
lib('json.JacksonJsonStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
9090
lib('json.JsonSimpleStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',

lib/build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ versionCompatibility {
4040
]
4141
targetSourceSetName = 'ktlint'
4242
}
43+
namespaces.register('Cleanthat') {
44+
versions = [
45+
'2.1',
46+
]
47+
targetSourceSetName = 'cleanthat'
48+
}
4349
}
4450
}
4551

@@ -103,9 +109,8 @@ dependencies {
103109

104110
gsonCompileOnly 'com.google.code.gson:gson:2.10.1'
105111

106-
// TODO How can one add a test module like 'compatKtLint0Dot48Dot0'?
107-
// cleanthatCompileAndTestOnly 'io.github.solven-eu.cleanthat:java:2.1'
108112
cleanthatCompileOnly 'io.github.solven-eu.cleanthat:java:2.1'
113+
compatCleanthat2Dot1CompileAndTestOnly 'io.github.solven-eu.cleanthat:java:2.1'
109114
}
110115

111116
// we'll hold the core lib to a high standard

lib/src/testCleanthat/java/com/diffplug/spotless/glue/java/JavaCleanthatRefactorerFuncTest.java

Lines changed: 0 additions & 72 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright 2023 DiffPlug
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.diffplug.spotless.glue.java;
17+
18+
import org.assertj.core.api.Assertions;
19+
import org.junit.jupiter.api.Test;
20+
21+
import eu.solven.cleanthat.engine.java.refactorer.JavaRefactorer;
22+
23+
public class JavaCleanthatRefactorerFuncTest {
24+
@Test
25+
public void testMutatorsDetection() {
26+
Assertions.assertThat(JavaRefactorer.getAllIncluded()).isNotEmpty();
27+
}
28+
}

plugin-gradle/src/test/java/com/diffplug/gradle/spotless/CleanthatJavaIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void integration() throws IOException {
3131
"spotless {",
3232
" java {",
3333
" target file('test.java')",
34-
" cleanthat().sourceJdk('11')",
34+
" cleanthat().sourceCompatibility('11')",
3535
" }",
3636
"}");
3737

0 commit comments

Comments
 (0)