Line data Source code
1 : // Copyright (C) 2020 The Android Open Source Project 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 : 15 : package com.google.gerrit.acceptance.testsuite.change; 16 : 17 : import com.google.auto.value.AutoValue; 18 : import com.google.gerrit.entities.Change; 19 : 20 : /** Representation of a change used for testing purposes. */ 21 : @AutoValue 22 2 : public abstract class TestChange { 23 : 24 : /** 25 : * The numeric change ID, sometimes also called change number or legacy change ID. Unique per 26 : * host. 27 : */ 28 : public abstract Change.Id numericChangeId(); 29 : 30 : /** 31 : * The Change-Id as specified in the commit message. Consists of an {@code I} followed by a 40-hex 32 : * string. Only unique per project-branch. 33 : */ 34 : public abstract String changeId(); 35 : 36 : static Builder builder() { 37 2 : return new AutoValue_TestChange.Builder(); 38 : } 39 : 40 : @AutoValue.Builder 41 2 : abstract static class Builder { 42 : abstract Builder numericChangeId(Change.Id numericChangeId); 43 : 44 : abstract Builder changeId(String changeId); 45 : 46 : abstract TestChange build(); 47 : } 48 : }