View Javadoc
1   /**
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    *  to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    *  with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
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  }