package de.plushnikov.intellij.plugin;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.roots.ContentEntry;
import com.intellij.openapi.roots.LanguageLevelModuleExtension;
import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor;
import com.intellij.testFramework.fixtures.MavenDependencyUtil;
import org.jetbrains.annotations.NotNull;

public class LombokTestUtil {

  public static final String MAVEN_COORDINATES = "org.projectlombok:lombok:" + Version.LAST_LOMBOK_VERSION;
  public static final DefaultLightProjectDescriptor LOMBOK_DESCRIPTOR = new DefaultLightProjectDescriptor() {
    @Override
    public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) {
      MavenDependencyUtil.addFromMaven(model, MAVEN_COORDINATES);
      MavenDependencyUtil.addFromMaven(model, "com.google.guava:guava:27.0.1-jre");
      model.getModuleExtension(LanguageLevelModuleExtension.class).setLanguageLevel(LanguageLevel.JDK_1_8);
    }
  };

  public static final DefaultLightProjectDescriptor LOMBOK_OLD_DESCRIPTOR = new DefaultLightProjectDescriptor() {
    @Override
    public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) {
      MavenDependencyUtil.addFromMaven(model, "org.projectlombok:lombok:1.18.2");
      MavenDependencyUtil.addFromMaven(model, "com.google.guava:guava:27.0.1-jre");
      model.getModuleExtension(LanguageLevelModuleExtension.class).setLanguageLevel(LanguageLevel.JDK_1_8);
    }
  };
}

@@ -528,16 +528,23 @@
  String 
+LOMBOK_
 MAVEN_CO
@@ -614,16 +614,17 @@
 ERSION;%0A
+%0A
   public
@@ -915,16 +915,23 @@
 (model, 
+LOMBOK_
 MAVEN_CO
@@ -1490,92 +1490,8 @@
 %22);%0A
-      MavenDependencyUtil.addFromMaven(model, %22com.google.guava:guava:27.0.1-jre%22);%0A
     

remove guava library from old-test configuration