KtLintStep { public static FormatterStep create(Provisioner provisioner) { return create(defaultVersion(), provisioner); } private  KtLintStep(); static FormatterStep create(Provisioner provisioner); static FormatterStep create(String version, Provisioner provisioner); static FormatterStep create(String version, Provisioner provisioner, Map<String, String> userData); static FormatterStep createForScript(String version, Provisioner provisioner); static FormatterStep createForScript(String version, Provisioner provisioner, Map<String, String> userData); static String defaultVersion();  }
@Test public void behavior() throws Exception { FormatterStep step = KtLintStep.create(TestProvisioner.jcenter()); StepHarness.forStep(step) .testResource("kotlin/ktlint/basic.dirty", "kotlin/ktlint/basic.clean") .testResourceException("kotlin/ktlint/unsolvable.dirty", assertion -> { assertion.isInstanceOf(AssertionError.class); assertion.hasMessage("Error on line: 1, column: 1\n" + "Wildcard import"); }); }
@Test public void worksShyiko() throws Exception { FormatterStep step = KtLintStep.create("0.31.0", TestProvisioner.jcenter()); StepHarness.forStep(step) .testResource("kotlin/ktlint/basic.dirty", "kotlin/ktlint/basic.clean") .testResourceException("kotlin/ktlint/unsolvable.dirty", assertion -> { assertion.isInstanceOf(AssertionError.class); assertion.hasMessage("Error on line: 1, column: 1\n" + "Wildcard import"); }); }
@Test public void worksPinterestAndPre034() throws Exception { FormatterStep step = KtLintStep.create("0.32.0", TestProvisioner.jcenter()); StepHarness.forStep(step) .testResource("kotlin/ktlint/basic.dirty", "kotlin/ktlint/basic.clean") .testResourceException("kotlin/ktlint/unsolvable.dirty", assertion -> { assertion.isInstanceOf(AssertionError.class); assertion.hasMessage("Error on line: 1, column: 1\n" + "Wildcard import"); }); }
@Test public void worksAlpha1() throws Exception { FormatterStep step = KtLintStep.create("0.38.0-alpha01", TestProvisioner.jcenter()); StepHarness.forStep(step) .testResource("kotlin/ktlint/basic.dirty", "kotlin/ktlint/basic.clean"); }
@Test public void equality() throws Exception { new SerializableEqualityTester() { String version = "0.2.2"; @Override protected void setupTest(API api) { api.areDifferentThan(); version = "0.2.1"; api.areDifferentThan(); } @Override protected FormatterStep create() { String finalVersion = this.version; return KtLintStep.create(finalVersion, TestProvisioner.mavenCentral()); } }.testEquals(); }