lundi 25 juillet 2016

How can I replace deprecated method Mockit.setUpMock?

I have some code, which is using old version of jmockit library. I find out that setUpMock method of Mockit class is deprecated, but I cann't find on Jmockit API documentation explanation, how can I replace code like below.

@Test(expected=IllegalArgumentException.class)
public void updateWithBadRownum() throws Exception
{
    Mockit.setUpMock(Tool.class, new MockTool()); //It doesn't support on latest version of jmockit
    Mockit.setUpMock(Criteria.class, new MockCriteria());
    new TaskInitializer().populateSchemas(cnn, 10);
    Map parameters = new HashMap();
    parameters.put("ROWNUM", "abc");
    Assert.assertTrue(4 == StatusUpdaterImpl.execute(parameters));
} 

Aucun commentaire:

Enregistrer un commentaire