@@ -0,0 +1,3211 @@
+/*%0A * Copyright 2017, TeamDev Ltd. All rights reserved.%0A *%0A * Redistribution and use in source and/or binary forms, with or without%0A * modification, must retain the above copyright notice and the following%0A * disclaimer.%0A *%0A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS%0A * %22AS IS%22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT%0A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR%0A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT%0A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,%0A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT%0A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,%0A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY%0A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT%0A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE%0A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A */%0A%0Apackage org.spine3.tools.codestyle.javadoc;%0A%0Aimport org.junit.Test;%0Aimport org.spine3.tools.codestyle.StepConfiguration;%0Aimport org.spine3.tools.codestyle.rightmargin.RightMarginValidator;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.Paths;%0A%0Aimport static org.junit.Assert.*;%0A%0Apublic class InvalidFqnUsageValidatorShould %7B%0A    public InvalidFqnUsageValidator validator;%0A%0A    @Test(expected = RuntimeException.class)%0A    public void throw_exception_for_invalid_fqn_links_over_threshold() throws InvalidFqnUsageException %7B%0A        validator = setUpValidator(2, %22error%22);%0A        validator.validate(getPath(%22MultipleWrongFqnLinks.java%22));%0A    %7D%0A%0A    @Test(expected = RuntimeException.class)%0A    public void throw_exception_file_format_is_not_utf8() throws InvalidFqnUsageException %7B%0A        validator = setUpValidator(2, %22error%22);%0A        validator.validate(getPath(%22MultipleWrongFqnLinks.java%22));%0A    %7D%0A%0A    @Test%0A    public void check_only_files_with_java_extension() %7B%0A        validator = setUpValidator(0, %22error%22);%0A        validator.validate(getPath(%22.hiden_file%22));%0A    %7D%0A%0A    @Test%0A    public void throw_warning_for_invalid_fqn_links_over_threshold() %7B%0A        validator = setUpValidator(2, %22warn%22);%0A        validator.validate(getPath(%22MultipleWrongFqnLinks.java%22));%0A    %7D%0A%0A    @Test%0A    public void allow_correct_fqn_links() throws IOException %7B%0A        validator = setUpValidator(0, %22error%22);%0A        validator.validate(getPath(%22AllowedFqnFormats.java%22));%0A%0A    %7D%0A%0A    private static InvalidFqnUsageValidator setUpValidator(int threshold, String reportType) %7B%0A        final StepConfiguration configuration = new StepConfiguration();%0A        configuration.setThreshold(threshold);%0A        configuration.setReportType(reportType);%0A        InvalidFqnUsageValidator validator = new InvalidFqnUsageValidator(configuration);%0A        return validator;%0A    %7D%0A%0A    private Path getPath (String fileName)%7B%0A        final ClassLoader classLoader = getClass().getClassLoader();%0A        final File file = new File(classLoader.getResource(fileName).getFile());%0A        final Path path = Paths.get(file.getAbsolutePath());%0A        return path;%0A    %7D%0A%7D%0A

Add unit tests for `InvalidFqnUsageValidator`.