File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
src/test/java/org/openrewrite/java/migrate Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change 2020import org .openrewrite .InMemoryExecutionContext ;
2121import org .openrewrite .test .RewriteTest ;
2222
23+ import static org .assertj .core .api .Assertions .assertThat ;
2324import static org .junit .jupiter .api .Assertions .assertTrue ;
2425import static org .openrewrite .test .SourceSpecs .text ;
2526
@@ -28,33 +29,31 @@ class UpdateSdkManTest implements RewriteTest {
2829
2930 @ DocumentExample
3031 @ Test
31- void updateVersionUsingMajorOnly () {
32+ void updateVersionExact () {
3233 rewriteRun (
33- spec -> spec .recipe (new UpdateSdkMan ("17" , null )),
34+ spec -> spec .recipe (new UpdateSdkMan ("17.0.14 " , null )),
3435 text (
3536 """
36- java=11.0.25 -tem
37+ java=11.1.2 -tem
3738 """ ,
3839 """
39- java=17.0.15 -tem
40+ java=17.0.14 -tem
4041 """ ,
4142 spec -> spec .path (".sdkmanrc" )
4243 )
4344 );
4445 }
4546
4647 @ Test
47- void updateVersionExact () {
48+ void updateVersionUsingMajorOnly () {
4849 rewriteRun (
49- spec -> spec .recipe (new UpdateSdkMan ("17.0.14 " , null )),
50+ spec -> spec .recipe (new UpdateSdkMan ("17" , null )),
5051 text (
5152 """
52- java=11.1.2-tem
53- """ ,
54- """
55- java=17.0.14-tem
53+ java=11.0.25-tem
5654 """ ,
5755 spec -> spec .path (".sdkmanrc" )
56+ .after (sdkmanrc -> assertThat (sdkmanrc ).containsOnlyOnce ("java=" ).containsPattern ("java=17" ).actual ())
5857 )
5958 );
6059 }
You can’t perform that action at this time.
0 commit comments