[lombok] AddAbstractAndStaticModifiersFix: use PsiUpdateModCommandAction; better test (IDEA-329939)

GitOrigin-RevId: 8c79904013582ccaf02f69c74bc1c8b18fd76252
This commit is contained in:
Tagir Valeev
2023-09-18 10:25:02 +02:00
committed by intellij-monorepo-bot
parent d83f77f3d8
commit 5bcfe1fdef

View File

@@ -14,6 +14,7 @@ import java.util.List;
public class SuperBuilderQuickFixTest extends AbstractLombokLightCodeInsightTestCase {
public void testAddModifiersAbstractAndStaticOnInnerBuilderClass() {
myFixture.enableInspections(LombokInspection.class);
@Language("JAVA") final String text = """
import lombok.experimental.SuperBuilder;
@@ -35,8 +36,28 @@ public class SuperBuilderQuickFixTest extends AbstractLombokLightCodeInsightTest
}
""";
myFixture.configureByText(JavaFileType.INSTANCE, text);
IntentionAction action = myFixture.findSingleIntention("Make 'DeltaOfferComponentBuilder' abstract and static");
myFixture.launchAction(action);
myFixture.checkResult("""
import lombok.experimental.SuperBuilder;
assertTrue(hasActionWithText("Make 'DeltaOfferComponentBuilder' abstract and static"));
@SuperBuilder
class DeltaComponentWithSalesAndTechComponentId {
}
@SuperBuilder
public class DeltaOfferComponent extends DeltaComponentWithSalesAndTechComponentId {
Integer max;
public abstract static class DeltaOfferComponentBuilder {
public DeltaOfferComponentBuilder max(Integer max) {
this.max = max;
return this;
}
}
}
""");
}
public void testAddModifiersAbstractOnInnerBuilderClass() {