@Test public void buildShouldReturnJavaCode() throws Exception { final TypeSpec typeSpec = TypeSpec.classBuilder("Test") .addModifiers(Modifier.PUBLIC) .build(); final String actual = underTest.build("io.t28.example", typeSpec); assertThat(actual) .isEqualTo("package io.t28.example;\n\npublic class Test {\n}\n"); }
@Nonnull @Override public String build(@Nonnull String packageName, @Nonnull TypeSpec typeSpec) throws JavaBuildException { return JavaFile.builder(packageName, typeSpec) .indent(INDENT) .skipJavaLangImports(true) .build() .toString(); }
JavaBuilderImpl implements JavaBuilder { @Nonnull @Override public String build(@Nonnull String packageName, @Nonnull TypeSpec typeSpec) throws JavaBuildException { return JavaFile.builder(packageName, typeSpec) .indent(INDENT) .skipJavaLangImports(true) .build() .toString(); } }
JavaBuilderImpl implements JavaBuilder { @Nonnull @Override public String build(@Nonnull String packageName, @Nonnull TypeSpec typeSpec) throws JavaBuildException { return JavaFile.builder(packageName, typeSpec) .indent(INDENT) .skipJavaLangImports(true) .build() .toString(); }  }
JavaBuilderImpl implements JavaBuilder { @Nonnull @Override public String build(@Nonnull String packageName, @Nonnull TypeSpec typeSpec) throws JavaBuildException { return JavaFile.builder(packageName, typeSpec) .indent(INDENT) .skipJavaLangImports(true) .build() .toString(); }  @Nonnull @Override String build(@Nonnull String packageName, @Nonnull TypeSpec typeSpec); }
JavaBuilderImpl implements JavaBuilder { @Nonnull @Override public String build(@Nonnull String packageName, @Nonnull TypeSpec typeSpec) throws JavaBuildException { return JavaFile.builder(packageName, typeSpec) .indent(INDENT) .skipJavaLangImports(true) .build() .toString(); }  @Nonnull @Override String build(@Nonnull String packageName, @Nonnull TypeSpec typeSpec);  }