Skip to content

Commit

Permalink
Convenience builder for dependencies from classpath
Browse files Browse the repository at this point in the history
  • Loading branch information
jkschneider committed Aug 4, 2020
1 parent 80dfc6a commit f440a71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Metrics;
import org.openrewrite.Parser;
import org.openrewrite.SourceFile;
import org.openrewrite.internal.lang.Nullable;
import org.openrewrite.java.style.ImportLayoutStyle;
import org.openrewrite.java.style.TabAndIndentStyle;
Expand Down Expand Up @@ -166,6 +165,11 @@ public B classpath(List<Path> classpath) {
return (B) this;
}

public B classpath(String... classpath) {
this.classpath = dependenciesFromClasspath(classpath);
return (B) this;
}

public B importStyle(ImportLayoutStyle importStyle) {
this.styles.add(importStyle);
return (B) this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
package org.openrewrite.java

import org.junit.jupiter.api.Test
import org.openrewrite.RefactorVisitorTest
import org.openrewrite.whenParsedBy

interface AddImportTest {
interface AddImportTest: RefactorVisitorTest {
@Test
fun addMultipleImports(jp: JavaParser) {
"class A {}"
Expand Down

0 comments on commit f440a71

Please sign in to comment.