// Path: src/main/java/org/killbill/billing/plugin/simpletax/config/http/VatinController.java
// public static final class VATINRsc {
//     /**
//      * The identifier of the account this VAT Identification Number belongs
//      * to.
//      */
//     // TODO: have immutable resources. Convert to final field?
//     public UUID accountId;
//     /** The VAT Identification Number. */
//     // TODO: have immutable resources. Convert to final field?
//     public VATIN vatin;
// 
//     /**
//      * Constructs a new VAT Identification Number resource.
//      *
//      * @param accountId
//      *            An account identifier.
//      * @param vatin
//      *            A VAT Identification Number.
//      */
//     @JsonCreator
//     public VATINRsc(@JsonProperty("accountId") UUID accountId, @JsonProperty("vatin") VATIN vatin) {
//         // TODO: have more reliable resources. Add
//         // Precondition.checkNonNull()
//         this.accountId = accountId;
//         this.vatin = vatin;
//     }
// }
// 
// Path: src/main/java/org/killbill/billing/plugin/simpletax/internal/VATIN.java
// public class VATIN {
// 
//     private static final VATINValidator VALIDATOR = new VATINValidator();
// 
//     private String number;
// 
//     /**
//      * @param number
//      *            A valid VAT Identificaiton Number.
//      * @throws IllegalArgumentException
//      *             When the VAT number is invalid.
//      */
//     @JsonCreator
//     public VATIN(String number) throws IllegalArgumentException {
//         super();
//         checkArgument(VALIDATOR.apply(number), "Illegal VAT Identification Number: [%s]", number);
//         this.number = number;
//     }
// 
//     /**
//      * @return The VAT Identificaiton Number.
//      */
//     @JsonValue
//     public String getNumber() {
//         return number;
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (obj == null) {
//             return false;
//         }
//         if (obj == this) {
//             return true;
//         }
//         if (obj.getClass() != getClass()) {
//             return false;
//         }
//         VATIN rhs = (VATIN) obj;
//         return new EqualsBuilder().append(number, rhs.number).isEquals();
//     }
// 
//     @Override
//     public int hashCode() {
//         return new HashCodeBuilder().append(number).toHashCode();
//     }
// 
//     @Override
//     public String toString() {
//         return new ToStringBuilder(this, SHORT_STYLE)//
//                 .append("number", number)//
//                 .toString();
//     }
// }
// 
// Path: src/test/java/org/killbill/billing/test/helpers/CustomFieldBuilder.java
// @SuppressWarnings("javadoc")
// public class CustomFieldBuilder implements Builder<CustomField> {
// 
//     private UUID objectId;
//     private ObjectType objectType;
//     private String fieldName, fieldValue;
// 
//     @Override
//     public CustomField build() {
//         return ImmutableCustomField.builder()//
//                 .withObjectId(objectId)//
//                 .withObjectType(objectType)//
//                 .withFieldName(fieldName)//
//                 .withFieldValue(fieldValue)//
//                 .build();
//     }
// 
//     public static CustomFieldBuilder copy(CustomFieldBuilder that) {
//         return new CustomFieldBuilder()//
//                 .withObjectType(that.objectType)//
//                 .withObjectId(that.objectId)//
//                 .withFieldName(that.fieldName)//
//                 .withFieldValue(that.fieldValue);
//     }
// 
//     public CustomFieldBuilder withObjectId(UUID objectId) {
//         this.objectId = objectId;
//         return this;
//     }
// 
//     public CustomFieldBuilder withObjectType(ObjectType objectType) {
//         this.objectType = objectType;
//         return this;
//     }
// 
//     public CustomFieldBuilder withFieldName(String fieldName) {
//         this.fieldName = fieldName;
//         return this;
//     }
// 
//     public CustomFieldBuilder withFieldValue(String fieldValue) {
//         this.fieldValue = fieldValue;
//         return this;
//     }
// }


import static com.google.common.collect.Lists.newArrayList;
import static java.util.UUID.randomUUID;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
import java.util.List;
import java.util.UUID;
import org.killbill.billing.plugin.api.PluginTenantContext;
import org.killbill.billing.plugin.simpletax.config.http.VatinController.VATINRsc;
import org.killbill.billing.plugin.simpletax.internal.VATIN;
import org.killbill.billing.tenant.api.Tenant;
import org.killbill.billing.test.helpers.CustomFieldBuilder;
import org.killbill.billing.util.callcontext.TenantContext;
import org.killbill.killbill.osgi.libs.killbill.OSGIKillbillLogService;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/*
 * Copyright 2015 Benjamin Gandon
 *
 * 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 org.killbill.billing.plugin.simpletax.config.http;




/**
 * @author Benjamin Gandon
 */
@SuppressWarnings("javadoc")
public class TestVATINController {
    private static final String FR_TEST6_NUM = "FR78666666666";
    private static final String FR_TEST7_NUM = "FR89777777777";
// Path: src/main/java/org/killbill/billing/plugin/simpletax/config/http/VatinController.java
// public static final class VATINRsc {
//     /**
//      * The identifier of the account this VAT Identification Number belongs
//      * to.
//      */
//     // TODO: have immutable resources. Convert to final field?
//     public UUID accountId;
//     /** The VAT Identification Number. */
//     // TODO: have immutable resources. Convert to final field?
//     public VATIN vatin;
// 
//     /**
//      * Constructs a new VAT Identification Number resource.
//      *
//      * @param accountId
//      *            An account identifier.
//      * @param vatin
//      *            A VAT Identification Number.
//      */
//     @JsonCreator
//     public VATINRsc(@JsonProperty("accountId") UUID accountId, @JsonProperty("vatin") VATIN vatin) {
//         // TODO: have more reliable resources. Add
//         // Precondition.checkNonNull()
//         this.accountId = accountId;
//         this.vatin = vatin;
//     }
// }
// 
// Path: src/main/java/org/killbill/billing/plugin/simpletax/internal/VATIN.java
// public class VATIN {
// 
//     private static final VATINValidator VALIDATOR = new VATINValidator();
// 
//     private String number;
// 
//     /**
//      * @param number
//      *            A valid VAT Identificaiton Number.
//      * @throws IllegalArgumentException
//      *             When the VAT number is invalid.
//      */
//     @JsonCreator
//     public VATIN(String number) throws IllegalArgumentException {
//         super();
//         checkArgument(VALIDATOR.apply(number), "Illegal VAT Identification Number: [%s]", number);
//         this.number = number;
//     }
// 
//     /**
//      * @return The VAT Identificaiton Number.
//      */
//     @JsonValue
//     public String getNumber() {
//         return number;
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (obj == null) {
//             return false;
//         }
//         if (obj == this) {
//             return true;
//         }
//         if (obj.getClass() != getClass()) {
//             return false;
//         }
//         VATIN rhs = (VATIN) obj;
//         return new EqualsBuilder().append(number, rhs.number).isEquals();
//     }
// 
//     @Override
//     public int hashCode() {
//         return new HashCodeBuilder().append(number).toHashCode();
//     }
// 
//     @Override
//     public String toString() {
//         return new ToStringBuilder(this, SHORT_STYLE)//
//                 .append("number", number)//
//                 .toString();
//     }
// }
// 
// Path: src/test/java/org/killbill/billing/test/helpers/CustomFieldBuilder.java
// @SuppressWarnings("javadoc")
// public class CustomFieldBuilder implements Builder<CustomField> {
// 
//     private UUID objectId;
//     private ObjectType objectType;
//     private String fieldName, fieldValue;
// 
//     @Override
//     public CustomField build() {
//         return ImmutableCustomField.builder()//
//                 .withObjectId(objectId)//
//                 .withObjectType(objectType)//
//                 .withFieldName(fieldName)//
//                 .withFieldValue(fieldValue)//
//                 .build();
//     }
// 
//     public static CustomFieldBuilder copy(CustomFieldBuilder that) {
//         return new CustomFieldBuilder()//
//                 .withObjectType(that.objectType)//
//                 .withObjectId(that.objectId)//
//                 .withFieldName(that.fieldName)//
//                 .withFieldValue(that.fieldValue);
//     }
// 
//     public CustomFieldBuilder withObjectId(UUID objectId) {
//         this.objectId = objectId;
//         return this;
//     }
// 
//     public CustomFieldBuilder withObjectType(ObjectType objectType) {
//         this.objectType = objectType;
//         return this;
//     }
// 
//     public CustomFieldBuilder withFieldName(String fieldName) {
//         this.fieldName = fieldName;
//         return this;
//     }
// 
//     public CustomFieldBuilder withFieldValue(String fieldValue) {
//         this.fieldValue = fieldValue;
//         return this;
//     }
// }


// Path: src/test/java/org/killbill/billing/plugin/simpletax/config/http/TestVATINController.java
import static com.google.common.collect.Lists.newArrayList;
import static java.util.UUID.randomUUID;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
import java.util.List;
import java.util.UUID;
import org.killbill.billing.plugin.api.PluginTenantContext;
import org.killbill.billing.plugin.simpletax.config.http.VatinController.VATINRsc;
import org.killbill.billing.plugin.simpletax.internal.VATIN;
import org.killbill.billing.tenant.api.Tenant;
import org.killbill.billing.test.helpers.CustomFieldBuilder;
import org.killbill.billing.util.callcontext.TenantContext;
import org.killbill.killbill.osgi.libs.killbill.OSGIKillbillLogService;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

/*
 * Copyright 2015 Benjamin Gandon
 *
 * 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 org.killbill.billing.plugin.simpletax.config.http;




/**
 * @author Benjamin Gandon
 */
@SuppressWarnings("javadoc")
public class TestVATINController {
    private static final String FR_TEST6_NUM = "FR78666666666";
    private static final String FR_TEST7_NUM = "FR89777777777";
    private static final VATIN FR_TEST6 = new VATIN(FR_TEST6_NUM);