config.testingPatternExplicitComment = TestingPatternExplicitComment.ArrangeActAssert;
TestMethodGeneratorImpl localGenerator = new TestMethodGeneratorImpl(config, lineBreakProvider);
String sourceCodeString = "package hoge.foo; import java.util.List; public class Sample { public Sample() {}\r\n public int doSomething(String str, long longValue) throws Throwable { System.out.println(\"aaaa\") } }";
ClassMeta targetClassMeta = classMetaExtractor.extract(sourceCodeString);
localGenerator.initialize(targetClassMeta);
MethodMeta targetMethodMeta = targetClassMeta.methods.get(0);
TestMethodMeta testMethodMeta = localGenerator.getTestMethodMeta(targetMethodMeta);
// when
String actual = localGenerator.getTestMethodSourceCode(testMethodMeta);
// then
String expected = " public void test_doSomething_A$String$long() throws Throwable {\r\n // TODO auto-generated by JUnit Helper.\r\n // Arrange\r\n Sample target = new Sample();\r\n String str = null;\r\n long longValue = 0L;\r\n // Act\r\n int actual = target.doSomething(str, longValue);\r\n // Assert\r\n int expected = 0;\r\n assertEquals(expected, actual);\r\n }\r\n";