1   /*
2    * Copyright (C) 2010 Atlassian
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package com.atlassian.jira.rest.client.internal.json;
18  
19  import com.atlassian.jira.rest.client.TestUtil;
20  import com.atlassian.jira.rest.client.domain.BasicComponent;
21  import com.atlassian.jira.rest.client.domain.BasicUser;
22  import com.atlassian.jira.rest.client.domain.Version;
23  
24  import static com.atlassian.jira.rest.client.TestUtil.toUri;
25  
26  /**
27   * Constants used in various unit tests.
28   * All constants including full URIs are usually useless in integration tests though, as during integration
29   * tests we may be testing against a JIRA running on a different port and with a different web context 
30   *
31   * @since v0.1
32   */
33  public class TestConstants {
34  	public static final String USER1_USERNAME = "wseliga";
35  
36  	public static final String USER1_PASSWORD = "wseliga";
37  
38  	public static final BasicUser USER1 = new BasicUser(toUri("http://localhost:8090/jira/rest/api/latest/user?username=wseliga"), USER1_USERNAME, "Wojciech Seliga");
39  
40  	public static final BasicUser USER_ADMIN = new BasicUser(toUri("http://localhost:8090/jira/rest/api/latest/user?username=admin"), "admin", "Administrator");
41  
42  	public static final String USER2_USERNAME = "user";
43  
44  	public static final String USER2_PASSWORD = "user";
45  
46  	public static final BasicUser USER2 = new BasicUser(toUri("http://localhost:8090/jira/rest/api/latest/user?username=user"), USER2_USERNAME, "My Test User");
47  
48  	public static final Version VERSION_1 = new Version(toUri("http://localhost:8090/jira/rest/api/latest/version/10001"),
49  			"1", "initial version", false, false, null);
50  
51  	public static final Version VERSION_1_1 = new Version(toUri("http://localhost:8090/jira/rest/api/latest/version/10000"),
52  			"1.1", "Some version", true, false, TestUtil.toDateTime("2010-08-25T00:00:00.000+0200"));
53  
54  	public static final BasicComponent BCOMPONENT_A = new BasicComponent(toUri("http://localhost:8090/jira/rest/api/latest/component/10000"),
55  			"Component A", "this is some description of component A");
56  
57  	public static final BasicComponent BCOMPONENT_B = new BasicComponent(toUri("http://localhost:8090/jira/rest/api/latest/component/10001"),
58  			"Component B", "another description");
59  }