ConstructorMetaExtractor { public ConstructorMetaExtractor initialize(String sourceCodeString) { initialize(null, sourceCodeString); return this; } ConstructorMetaExtractor(Configuration config); ConstructorMetaExtractor initialize(String sourceCodeString); ConstructorMetaExtractor initialize(ClassMeta classMeta, String sourceCodeString); List<ConstructorMeta> extract(String sourceCodeString);  }
@Test public void initialize_A$String() throws Exception { Configuration config = new Configuration(); ConstructorMetaExtractor target = new ConstructorMetaExtractor(config); String sourceCodeString = "package hoge; public class Sample { public void doSomething(String str) {} }"; ConstructorMetaExtractor actual = target.initialize(sourceCodeString); ConstructorMetaExtractor expected = target; assertEquals(expected, actual); }
@Test public void initialize_A$ClassMeta$String() throws Exception { Configuration config = new Configuration(); ConstructorMetaExtractor target = new ConstructorMetaExtractor(config); ClassMeta classMeta = mock(ClassMeta.class); String sourceCodeString = "package hoge; public class Sample { public void doSomething(String str) {} }"; ConstructorMetaExtractor actual = target.initialize(classMeta, sourceCodeString); ConstructorMetaExtractor expected = target; assertEquals(expected, actual); }
@Test public void initialize_A$String_StringIsNull() throws Exception { ConstructorMetaExtractor target = new ConstructorMetaExtractor(config); String sourceCodeString = "public class Sample {}"; ConstructorMetaExtractor actual = target.initialize(sourceCodeString); assertThat(actual, notNullValue()); }
@Test public void initialize_A$String_StringIsEmpty() throws Exception { ConstructorMetaExtractor target = new ConstructorMetaExtractor(config); String sourceCodeString = ""; ConstructorMetaExtractor actual = target.initialize(sourceCodeString); assertThat(actual, notNullValue()); }