Search in sources :

Example 1 with Web

use of com.kickstarter.models.Web in project android-oss by kickstarter.

the class ThanksShareHolderViewModelTest method setUpProjectWithWebUrls.

private Project setUpProjectWithWebUrls() {
    final Long creatorId = 15L;
    final User creator = UserFactory.creator().toBuilder().id(creatorId).build();
    final String slug = "best-project-2k19";
    final String projectUrl = "https://www.kck.str/projects/" + creator.id() + "/" + slug;
    final Web webUrls = Web.builder().project(projectUrl).rewards("$projectUrl/rewards").updates("$projectUrl/posts").build();
    return ProjectFactory.project().toBuilder().name("Best Project 2K19").urls(Urls.builder().web(webUrls).build()).build();
}
Also used : User(com.kickstarter.models.User) Web(com.kickstarter.models.Web)

Example 2 with Web

use of com.kickstarter.models.Web in project android-oss by kickstarter.

the class RefTagUtilsTest method testBuildCookieForRefTagAndProject_WithMalformedUrl.

@Test
public void testBuildCookieForRefTagAndProject_WithMalformedUrl() {
    final Web webUrls = ProjectFactory.project().urls().web().toBuilder().project("such:\\bad^<data").build();
    final Urls urls = ProjectFactory.project().urls().toBuilder().web(webUrls).build();
    final Project project = ProjectFactory.project().toBuilder().urls(urls).build();
    final RefTag refTag = RefTag.category();
    final HttpCookie cookie = RefTagUtils.buildCookieWithRefTagAndProject(refTag, project);
    assertNull(cookie);
}
Also used : Project(com.kickstarter.models.Project) Web(com.kickstarter.models.Web) RefTag(com.kickstarter.libs.RefTag) Urls(com.kickstarter.models.Urls) HttpCookie(java.net.HttpCookie) Test(org.junit.Test)

Aggregations

Web (com.kickstarter.models.Web)2 RefTag (com.kickstarter.libs.RefTag)1 Project (com.kickstarter.models.Project)1 Urls (com.kickstarter.models.Urls)1 User (com.kickstarter.models.User)1 HttpCookie (java.net.HttpCookie)1 Test (org.junit.Test)1