use of com.google.startupos.tools.build_file_generator.Protos.JavaClass in project startup-os by google.
the class JavaClassAnalyzerTest method hasMainMethodTest.
@Test
public void hasMainMethodTest() throws IOException {
String fileContent = "package com.test.tests;" + System.lineSeparator() + "public class SomeClass {" + System.lineSeparator() + " public static void main(String[] args) {}" + System.lineSeparator() + "}";
String filePath = fileUtils.joinToAbsolutePath(testFolder, "SomeClass.java");
fileUtils.writeStringUnchecked(fileContent, filePath);
JavaClass expectedJavaClass = JavaClass.newBuilder().setPackage("com.test.tests").setClassName("SomeClass").setHasMainMethod(true).build();
assertEquals(expectedJavaClass, javaClassAnalyzer.getJavaClass(filePath));
}
Aggregations