You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passes in 1.28.
Issue #404 was fixed for Expectations only.
StrictExpectations still return wrong instance.
@ContextConfiguration(classes = TestConfig.class)
public class JmockitTest extends AbstractTestNGSpringContextTests {
@Capturing
private SubManager manager;
@Autowired
private System system;
private Entity stub = new Entity();
@Test
public void test() {
new StrictExpectations() {{
manager.find();
result = stub;
}};
final Entity actual = system.call();
assertSame(actual, stub);
}
public static class System {
@Autowired
private SubManager manager;
public Entity call() {
return manager.find();
}
}
public interface SubManager extends Manager {
}
public interface Manager {
Entity find();
}
public static class Entity {
}
@Configuration
public static class TestConfig {
@Bean
protected System system() {
return new System();
}
@Bean
protected SubManager manager() {
return new SubManager() {
@Override
public Entity find() {
throw new UnsupportedOperationException();
}
};
}
}
}
The text was updated successfully, but these errors were encountered:
Passes in 1.28.
Issue #404 was fixed for Expectations only.
StrictExpectations still return wrong instance.
The text was updated successfully, but these errors were encountered: