import org.junit.Test;
import org.junit.runner.RunWith;
import static org.easymock.EasyMock.expect;
import static org.powermock.api.easymock.PowerMock.*;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.legacy.PowerMockRunner;
@RunWith(PowerMockRunner.class)
@PrepareForTest({Person.class })
public class PersonResourceTest {
@Test
public void testPost() {
Person personMock = createMock(Person.class);
expect(personMock.getName()).andReturn("Jon Smith");
replay(personMock);
// do the test...
Assert.assertEquals("Jon Smith", result.name);
}
}
Here’s where you can use Nano Banana Pro
3 days ago

No comments:
Post a Comment