// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.siyeh.ig.encapsulation;

import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
import com.siyeh.ig.LightInspectionTestCase;
import org.jetbrains.annotations.NotNull;

public class PublicFieldInspectionTest extends LightCodeInsightFixtureTestCase {
  @Override
  protected String getBasePath() {
    return LightInspectionTestCase.INSPECTION_GADGETS_TEST_DATA_PATH + "com/siyeh/igtest/encapsulation/public_field";
  }

  @NotNull
  @Override
  protected LightProjectDescriptor getProjectDescriptor() {
    return JAVA_8;
  }

  private void doTest() {
    PublicFieldInspection tool = new PublicFieldInspection();
    tool.ignoreEnums = true;
    tool.ignorableAnnotations.add("org.jetbrains.annotations.Nullable");
    myFixture.enableInspections(tool);
    myFixture.testHighlighting(getTestName(false) + ".java");
  }

  public void testPublicField() {
    doTest();
  }

}

@@ -195,120 +195,103 @@
 lij.
-testFramework.LightProjectDescriptor;%0Aimport com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
+codeInspection.InspectionProfileEntry;%0Aimport com.intellij.testFramework.LightProjectDescriptor
 ;%0Aim
@@ -374,16 +374,59 @@
 NotNull;
+%0Aimport org.jetbrains.annotations.Nullable;
 %0A%0Apublic
@@ -475,217 +475,40 @@
 ight
-CodeInsightFixtureTestCase %7B%0A  @Override%0A  protected String getBasePath() %7B%0A    return LightInspectionTestCase.INSPECTION_GADGETS_TEST_DATA_PATH + %22com/siyeh/igtest/encapsulation/public_field%22;%0A  %7D%0A
+InspectionTestCase %7B
 %0A  @
-Not
 Null
+able
 %0A  @
@@ -532,101 +532,44 @@
 ted 
-LightProjectDescriptor getProjectDescriptor() %7B%0A    return JAVA_8;%0A  %7D%0A%0A  private void doTest
+InspectionProfileEntry getInspection
 () %7B
@@ -741,103 +741,296 @@
     
-myFixture.enableInspections(tool);%0A    myFixture.testHighlighting(getTestName(false) + %22.java%22)
+return tool;%0A  %7D%0A%0A  @Override%0A  protected String getBasePath() %7B%0A    return LightInspectionTestCase.INSPECTION_GADGETS_TEST_DATA_PATH + %22com/siyeh/igtest/encapsulation/public_field%22;%0A  %7D%0A%0A  @NotNull%0A  @Override%0A  protected LightProjectDescriptor getProjectDescriptor() %7B%0A    return JAVA_8
 ;%0A  

fix testdata