ScalaFmtStep { public static FormatterStep create(Provisioner provisioner) { return create(defaultVersion(), provisioner, null); } private  ScalaFmtStep(); static FormatterStep create(Provisioner provisioner); static FormatterStep create(String version, Provisioner provisioner, @Nullable File configFile); static String defaultVersion();  }
@Test public void behaviorDefaultConfig() throws Exception { StepHarness.forStep(ScalaFmtStep.create("1.1.0", TestProvisioner.mavenCentral(), null)) .testResource("scala/scalafmt/basic.dirty", "scala/scalafmt/basic.clean_1.1.0"); StepHarness.forStep(ScalaFmtStep.create("2.0.1", TestProvisioner.mavenCentral(), null)) .testResource("scala/scalafmt/basic.dirty", "scala/scalafmt/basic.clean_2.0.1"); }
@Test public void behaviorCustomConfig() throws Exception { StepHarness.forStep(ScalaFmtStep.create("1.1.0", TestProvisioner.mavenCentral(), createTestFile("scala/scalafmt/scalafmt.conf"))) .testResource("scala/scalafmt/basic.dirty", "scala/scalafmt/basic.cleanWithCustomConf_1.1.0"); StepHarness.forStep(ScalaFmtStep.create("2.0.1", TestProvisioner.mavenCentral(), createTestFile("scala/scalafmt/scalafmt.conf"))) .testResource("scala/scalafmt/basic.dirty", "scala/scalafmt/basic.cleanWithCustomConf_2.0.1"); }
@Test public void behaviorDefaultConfigVersion_2_0_0() throws Exception { FormatterStep step = ScalaFmtStep.create("2.0.0", TestProvisioner.mavenCentral(), null); StepHarness.forStep(step) .testResource("scala/scalafmt/basic.dirty", "scala/scalafmt/basicPost2.0.0.clean"); }
@Test public void behaviorCustomConfigVersion_2_0_0() throws Exception { FormatterStep step = ScalaFmtStep.create("2.0.0", TestProvisioner.mavenCentral(), createTestFile("scala/scalafmt/scalafmt.conf")); StepHarness.forStep(step) .testResource("scala/scalafmt/basic.dirty", "scala/scalafmt/basicPost2.0.0.cleanWithCustomConf"); }
@Test public void equality() throws Exception { new SerializableEqualityTester() { String version = "0.5.1"; File configFile = null; @Override protected void setupTest(API api) throws IOException { api.areDifferentThan(); version = "0.5.0"; api.areDifferentThan(); configFile = createTestFile("scala/scalafmt/scalafmt.conf"); api.areDifferentThan(); configFile = createTestFile("scala/scalafmt/scalafmt2.conf"); api.areDifferentThan(); } @Override protected FormatterStep create() { return ScalaFmtStep.create(version, TestProvisioner.mavenCentral(), configFile); } }.testEquals(); }