blob: 7f838ee1cb97232aac1c668c5275aaf0c27f034c [file] [log] [blame]
Dave Borowitz9de65952012-08-13 16:09:45 -07001// Copyright 2012 Google Inc. All Rights Reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package com.google.gitiles;
16
17import javax.servlet.http.HttpServletRequest;
18
19/** {@link GitilesUrls} for testing. */
20public class TestGitilesUrls implements GitilesUrls {
21 public static final GitilesUrls URLS = new TestGitilesUrls();
Dave Borowitzd91bdf72013-01-10 20:07:32 -080022 public static final String HOST_NAME = "test-host";
Dave Borowitz9de65952012-08-13 16:09:45 -070023
24 @Override
25 public String getHostName(HttpServletRequest req) {
Dave Borowitzd91bdf72013-01-10 20:07:32 -080026 return HOST_NAME;
Dave Borowitz9de65952012-08-13 16:09:45 -070027 }
28
29 @Override
30 public String getBaseGitUrl(HttpServletRequest req) {
Antoine Mussob89ae942025-09-30 19:31:35 +020031 return "git://" + HOST_NAME + "/path-prefix";
Dave Borowitz9de65952012-08-13 16:09:45 -070032 }
33
34 @Override
35 public String getBaseGerritUrl(HttpServletRequest req) {
Antoine Mussob89ae942025-09-30 19:31:35 +020036 return "http://" + HOST_NAME + "-review/path-prefix/";
Dave Borowitz9de65952012-08-13 16:09:45 -070037 }
38
Dave Borowitzcf38c032016-05-02 11:06:23 -040039 private TestGitilesUrls() {}
Dave Borowitz9de65952012-08-13 16:09:45 -070040}