1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.creadur.whisker.model;
20
21 public class OrganisationBuilderForTesting {
22
23 public static final String DEFAULT_ORG_URL = "http://thirdparty.org";
24 public static final String DEFAULT_ORG_NAME = "thirdparty.org";
25 public static final String DEFAULT_ORG_ID = "third-party";
26 public static final String DEFAULT_PRIMARY_ORG_URL = "http://primary.org";
27 public static final String DEFAULT_PRIMARY_ORG_NAME = "primary organisation";
28 public static final String DEFAULT_PRIMARY_ORG_ID = "primary.org";
29
30 public static Organisation defaultPrimaryOrganisation() {
31 return new OrganisationBuilderForTesting()
32 .withId(DEFAULT_PRIMARY_ORG_ID)
33 .withName(DEFAULT_PRIMARY_ORG_NAME)
34 .withUrl(DEFAULT_PRIMARY_ORG_URL)
35 .build();
36 }
37
38 String id = DEFAULT_ORG_ID;
39 String name = DEFAULT_ORG_NAME;
40 String url = DEFAULT_ORG_URL;
41
42 public Organisation build() {
43 return new Organisation(id, name,url);
44 }
45
46 public OrganisationBuilderForTesting withId(String id) {
47 this.id = id;
48 return this;
49 }
50
51 public OrganisationBuilderForTesting withName(String name) {
52 this.name = name;
53 return this;
54 }
55
56 public OrganisationBuilderForTesting withUrl(String url) {
57 this.url = url;
58 return this;
59 }
60 }