// Copyright 2016 The Nomulus Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package google.registry.testing; import static google.registry.testing.DatastoreHelper.generateNewContactHostRoid; import static google.registry.testing.DatastoreHelper.generateNewDomainRoid; import static google.registry.testing.DatastoreHelper.persistResource; import static google.registry.util.DomainNameUtils.getTldFromDomainName; import static java.nio.charset.StandardCharsets.UTF_8; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.net.InetAddresses; import com.googlecode.objectify.Key; import google.registry.model.EppResource; import google.registry.model.contact.ContactAddress; import google.registry.model.contact.ContactPhoneNumber; import google.registry.model.contact.ContactResource; import google.registry.model.contact.PostalInfo; import google.registry.model.domain.DesignatedContact; import google.registry.model.domain.DomainResource; import google.registry.model.domain.Period; import google.registry.model.domain.secdns.DelegationSignerData; import google.registry.model.eppcommon.StatusValue; import google.registry.model.eppcommon.Trid; import google.registry.model.host.HostResource; import google.registry.model.registrar.Registrar; import google.registry.model.registrar.RegistrarAddress; import google.registry.model.registrar.RegistrarContact; import google.registry.model.reporting.HistoryEntry; import google.registry.util.Idn; import java.net.InetAddress; import java.util.List; import javax.annotation.Nullable; import org.joda.time.DateTime; /** Test helper methods for the rdap and whois packages. */ public final class FullFieldsTestEntityHelper { public static Registrar makeRegistrar( String clientId, String registrarName, Registrar.State state) { return makeRegistrar(clientId, registrarName, state, 1L); } public static Registrar makeRegistrar( String clientId, String registrarName, Registrar.State state, Long ianaIdentifier) { Registrar registrar = new Registrar.Builder() .setClientId(clientId) .setRegistrarName(registrarName) .setType(Registrar.Type.REAL) .setIanaIdentifier(ianaIdentifier) .setState(state) .setInternationalizedAddress(new RegistrarAddress.Builder() .setStreet(ImmutableList.of("123 Example Boulevard