public class TestAddMultiLingualInterceptor extends TestCase {
public void testInvoke() throws Exception {
AddMultiLingualInterceptor interceptor = new AddMultiLingualInterceptor();
MethodInvocation invoke = createMock(MethodInvocation.class);
ILocaleContainer localeContainer = createMock(ILocaleContainer.class);
ILabelManager labelManager = createMock(ILabelManager.class);
interceptor.setLabelManager(labelManager);
interceptor.setLocaleContainer(localeContainer);
expect(localeContainer.getLocale()).andReturn("it");
expectLastCall().anyTimes();
expect(labelManager.add(isA(Label.class))).andReturn(true);
expectLastCall().anyTimes();
replay(localeContainer);
replay(labelManager);
Hotel hotel = new Hotel();
hotel.setBriefdescription("Questo è un bedlkfj");
try {
expect(invoke.getArguments()).andReturn(new Object[] {(Object)hotel});
expect(invoke.proceed()).andReturn(null);
replay(invoke);
interceptor.invoke(invoke);
}catch(Throwable t){
assertTrue(false);
}