Skip to content

Instantly share code, notes, and snippets.

@TsuyoshiUshio
Created April 30, 2020 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TsuyoshiUshio/2b7d8853661c0e518c7382a1f2fca747 to your computer and use it in GitHub Desktop.
Save TsuyoshiUshio/2b7d8853661c0e518c7382a1f2fca747 to your computer and use it in GitHub Desktop.
jMockit sample (Missing Invocation)
public class SampleTest {
@Test
public void executeSample(
@Mocked final TypedData data1,
@Mocked final TypedData data2
) throws Exception {
new Expectations() {{
data1.getName(); result = "foo";
data2.getName(); result = "bar";
}};
assertEquals("foo", data1.getName());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment