MethodMetaExtractor { public MethodMetaExtractor initialize(String sourceCodeString) { return initialize(null, sourceCodeString); } MethodMetaExtractor(Configuration config); MethodMetaExtractor initialize(String sourceCodeString); MethodMetaExtractor initialize(ClassMeta classMeta); MethodMetaExtractor initialize(ClassMeta classMeta, String sourceCodeString); List<MethodMeta> extract(String sourceCodeString);  }
@Test public void initialize_A$ClassMeta() throws Exception { ClassMeta classMeta = mock(ClassMeta.class); MethodMetaExtractor actual = target.initialize(classMeta); assertNotNull(actual); }
@Test public void initialize_A$String_StringIsNull() throws Exception { MethodMetaExtractor target = new MethodMetaExtractor(config); String sourceCodeString = null; try { target.initialize(sourceCodeString); fail(); } catch (JUnitHelperCoreException e) { } }
@Test public void initialize_A$String_StringIsEmpty() throws Exception { MethodMetaExtractor target = new MethodMetaExtractor(config); String sourceCodeString = ""; MethodMetaExtractor actual = target.initialize(sourceCodeString); assertThat(actual, notNullValue()); }
@Test public void initialize_A$String() throws Exception { String sourceCodeString = "package hoge.foo; public class Sample { public Sample() {}\r\n public void doSomething(String str) { System.out.println(\"aaaa\") } }"; target.initialize(sourceCodeString); }