mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Test that update works for every field in RegistrarSettings
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=192348329
This commit is contained in:
parent
ea995cf801
commit
eb17851cb3
3 changed files with 150 additions and 0 deletions
|
@ -94,9 +94,21 @@ public class Address extends ImmutableObject implements Jsonifiable {
|
|||
.build();
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public Builder<? extends Address> asBuilder() {
|
||||
return new Builder<>(clone(this));
|
||||
}
|
||||
|
||||
/** A builder for constructing {@link Address}. */
|
||||
@VisibleForTesting
|
||||
public static class Builder<T extends Address> extends Buildable.Builder<T> {
|
||||
|
||||
public Builder() {}
|
||||
|
||||
protected Builder(T instance) {
|
||||
super(instance);
|
||||
}
|
||||
|
||||
public Builder<T> setStreet(ImmutableList<String> street) {
|
||||
checkArgument(
|
||||
street == null || (!street.isEmpty() && street.size() <= 3),
|
||||
|
|
|
@ -17,6 +17,7 @@ package google.registry.model.registrar;
|
|||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static google.registry.util.CollectionUtils.forceEmptyToNull;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.googlecode.objectify.annotation.Embed;
|
||||
import google.registry.model.eppcommon.Address;
|
||||
|
||||
|
@ -30,8 +31,20 @@ import google.registry.model.eppcommon.Address;
|
|||
@Embed
|
||||
public class RegistrarAddress extends Address {
|
||||
|
||||
@Override
|
||||
@VisibleForTesting
|
||||
public Builder asBuilder() {
|
||||
return new Builder(clone(this));
|
||||
}
|
||||
|
||||
/** Builder for {@link RegistrarAddress}. */
|
||||
public static class Builder extends Address.Builder<RegistrarAddress> {
|
||||
public Builder() {}
|
||||
|
||||
private Builder(RegistrarAddress instance) {
|
||||
super(instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegistrarAddress build() {
|
||||
RegistrarAddress instance = getInstance();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue