-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to verify Service implementation and fix the logic
- Loading branch information
Showing
2 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
rewrite-java/src/test/java/org/openrewrite/java/service/JavaNamingServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.openrewrite.java.service; | ||
|
||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.CsvSource; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class JavaNamingServiceTest { | ||
|
||
@ParameterizedTest | ||
@CsvSource(textBlock = """ | ||
foo_bar,fooBar | ||
foo$bar,fooBar | ||
foo_bar$,fooBar | ||
foo$bar$,fooBar | ||
""") | ||
void changeMethodName(String before, String after) { | ||
String actual = new JavaNamingService().standardizeMethodName(before); | ||
assertThat(actual).isEqualTo(after); | ||
} | ||
|
||
} |