Created
April 30, 2020 18:46
-
-
Save TsuyoshiUshio/5b4d8084a4dce50e2201a58600c0a093 to your computer and use it in GitHub Desktop.
jMockit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class InvocationRequestTest { | |
@Mocked | |
private ParameterBinding binding; | |
@Test | |
public void test(@Mocked final Some some) throws Exception { | |
new Expectations() {{ | |
binding.getName(); result = "ushio"; | |
some.getName(); result = "mocked"; | |
} | |
}; | |
Some other = new Some("yamada"); | |
assertEquals("ushio", binding.getName()); | |
assertEquals("mocked", some.getName()); | |
assertEquals("yamada", other.getName()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment