001/* 002 * Licensed under the Apache License, Version 2.0 (the "License"); 003 * you may not use this file except in compliance with the License. 004 * You may obtain a copy of the License at 005 * 006 * http://www.apache.org/licenses/LICENSE-2.0 007 * 008 * Unless required by applicable law or agreed to in writing, software 009 * distributed under the License is distributed on an "AS IS" BASIS, 010 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 011 * See the License for the specific language governing permissions and 012 * limitations under the License. 013 */ 014package org.gbif.api.util.validators.identifierschemes; 015 016import org.junit.jupiter.api.Test; 017 018import static org.junit.jupiter.api.Assertions.assertFalse; 019import static org.junit.jupiter.api.Assertions.assertTrue; 020 021/** Tests the {@link ViafValidator}. */ 022public class ViafValidatorTest { 023 024 private static final ViafValidator VALIDATOR = new ViafValidator(); 025 026 @Test 027 public void isValidTest() { 028 assertTrue(VALIDATOR.isValid("http://viaf.org/viaf/95138782")); 029 assertTrue(VALIDATOR.isValid("https://viaf.org/viaf/95138782")); 030 assertTrue(VALIDATOR.isValid("95138782")); 031 assertTrue(VALIDATOR.isValid("http://viaf.org/viaf/1281586699957272025921")); 032 033 assertFalse(VALIDATOR.isValid("http://viaf.org/viaf/12815866999572720259211")); 034 } 035}