Package sagan.blog

Examples of sagan.blog.PostMovedException


        Post post = postRepository.findByPublicSlugAndDraftFalseAndPublishAtBefore(publicSlug, now);
        if (post == null) {
            post = postRepository.findByPublicSlugAliasesInAndDraftFalseAndPublishAtBefore(
                    Collections.singleton(publicSlug), now);
            if (post != null) {
                throw new PostMovedException(post.getPublicSlug());
            }
            throw new PostNotFoundException(publicSlug);
        }
        return post;
    }
View Full Code Here


    }

    @Test
    public void handleBlogPostMovedExceptionRedirects() {
        String publicSlug = "slug";
        RedirectView result = blogController.handle(new PostMovedException(publicSlug));
        assertThat(result.getUrl(), equalTo("/blog/" + publicSlug));
    }
View Full Code Here

TOP

Related Classes of sagan.blog.PostMovedException

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.