Professional Documents
Culture Documents
Jmock Présentation Et Tutorial
Jmock Présentation Et Tutorial
Jmock Présentation Et Tutorial
Mohammed Boukoutaya
1. Les prérequis
2. La philosophie
3. L’utilisation de Jmock
Les prérequis
Accès complexe,
DataBase,
Utilisation de bibliothèques tierces
exactly(n).of The invocation is expected exactly n times. Note: one is a convenient shorthand for exactly(1).
between(min, max The invocation is expected at least min times and at most max times.
).of
allowing The invocation is allowed any number of times but does not have to happen.
The same as allowing. Allowing or ignoring should be chosen to make the test code
ignoring clearly express intent.
never The invocation is not expected at all. This is used to mak
setImposteriser(ClassImposteriser.INSTANCE);
};
context.checking(new Expectations() {
one(mockStub).searchByFullName(with(any(SearchByFullNameRequest.class)));
will(returnValue(searchByFullNameResponse));
});