Resource templateDirResource = mock(Resource.class, RETURNS_DEEP_STUBS);
when(templateDirResource.exists()).thenReturn(true);
when(templateDirResource.getFile().getPath()).thenReturn(templateDir);
GaeVelocityTemplateService templateService = new GaeVelocityTemplateService();
templateService.setGaeVelocityUtils(gaeVelocityUtils);
templateService.setTemplateDirResource(templateDirResource);
templateService.afterPropertiesSet();
GaeEmailService realEmailService = new GaeEmailService();
realEmailService.setGaeEmailUtils(gaeEmailUtils);
realEmailService.setTemplateService(templateService);
realEmailService.afterPropertiesSet();