Skip to content

Commit

Permalink
Move @Issue to existing test
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek authored Jan 5, 2024
1 parent 52b8f45 commit fe1ea8e
Showing 1 changed file with 1 addition and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,45 +65,6 @@ static void method(Logger logger, String name) {
);
}

@Test
@Issue("https://github.com/openrewrite/rewrite-logging-frameworks/issues/135")
void exceptionAppended() {
rewriteRun(
spec -> spec.recipeFromResources("org.openrewrite.java.logging.slf4j.ParameterizedLogging"),
//language=java
java(
"""
import org.slf4j.Logger;
class Test {
static void method(Logger logger, Class<?> clazz) {
try {
return clazz.newInstance();
} catch (InstantiationException | IllegalAccessException ex) {
logger.error("Cannot instantiate dependency: " + clazz, ex);
return null;
}
}
}
""",
"""
import org.slf4j.Logger;
class Test {
static void method(Logger logger, Class<?> clazz) {
try {
return clazz.newInstance();
} catch (InstantiationException | IllegalAccessException ex) {
logger.error("Cannot instantiate dependency: {}", clazz, ex);
return null;
}
}
}
"""
)
);
}

@SuppressWarnings("UnnecessaryToStringCall")
@Test
void noNeedToCallToStringOnParameterizedArgument() {
Expand Down Expand Up @@ -337,6 +298,7 @@ static void method(Logger logger, List<String> nameSpaces) {
}

@Test
@Issue("https://github.com/openrewrite/rewrite-logging-frameworks/issues/135")
void exceptionArgumentsWithThrowable() {
rewriteRun(
spec -> spec.recipe(new ParameterizedLogging("org.slf4j.Logger warn(..)", false)),
Expand Down

0 comments on commit fe1ea8e

Please sign in to comment.