public class Bean {
private final String state;
public class Bean(String state) {
this.state= state;
}
public VO process() {
// Process based on state.
// Return value object
}
}
public class Service {
private final Bean bean;
Service(Bean bean) {
this.bean = bean;
}
}
Mockito code
Bean bean = Mockito.mock(Bean.class //, not sure what to do);
// Stub behaviour.
Any help would be appreciated.
Bean bean = mock(Bean.class);
when(bean.process()).thenReturn(somethingThatShouldBeNamedVO);
Thanks,
James
> --
> You received this message because you are subscribed to the Google Groups "mockito" group.
> To post to this group, send email to moc...@googlegroups.com.
> To unsubscribe from this group, send email to mockito+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mockito?hl=en.
>
>