Package com.cedarsolutions.util.gae

Examples of com.cedarsolutions.util.gae.GaeEmailUtils


    @Test public void testConstructor() {
        GaeEmailService service = new GaeEmailService();
        assertNull(service.getGaeEmailUtils());
        assertNull(service.getTemplateService());

        GaeEmailUtils gaeEmailUtils = mock(GaeEmailUtils.class);
        service.setGaeEmailUtils(gaeEmailUtils);
        assertSame(gaeEmailUtils, service.getGaeEmailUtils());

        ITemplateService templateService = mock(ITemplateService.class);
        service.setTemplateService(templateService);
View Full Code Here


    }

    /** Test the afterPropertiesSet() method. */
    @Test public void testAfterPropertiesSet() throws Exception {
        GaeEmailService service = new GaeEmailService();
        GaeEmailUtils gaeEmailUtils = mock(GaeEmailUtils.class);
        ITemplateService templateService = mock(ITemplateService.class);

        service.setGaeEmailUtils(gaeEmailUtils);
        service.setTemplateService(templateService);
        service.afterPropertiesSet();
View Full Code Here

    }

    /** Create a service instance, properly mocked for testing. */
    private static GaeEmailService createService() {
        GaeEmailService service = new GaeEmailService();
        GaeEmailUtils gaeEmailUtils = mock(GaeEmailUtils.class);
        ITemplateService templateService = mock(ITemplateService.class);

        service.setGaeEmailUtils(gaeEmailUtils);
        service.setTemplateService(templateService);
        service.afterPropertiesSet();
View Full Code Here

     *
     * @return Partially-mocked email service that can be used for testing.
     */
    public static IEmailService createPartiallyMockedEmailService(String templateDir) {
        try {
            GaeEmailUtils gaeEmailUtils = mock(GaeEmailUtils.class);
            GaeVelocityUtils gaeVelocityUtils = GaeVelocityUtils.getInstance();

            Resource templateDirResource = mock(Resource.class, RETURNS_DEEP_STUBS);
            when(templateDirResource.exists()).thenReturn(true);
            when(templateDirResource.getFile().getPath()).thenReturn(templateDir);
View Full Code Here

TOP

Related Classes of com.cedarsolutions.util.gae.GaeEmailUtils

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.