static String validatePathName(String toValidate) {
        String fileName = getFileName(toValidate);
        if (!fileName.endsWith(FINAL_SUFFIX)) {
            throw new KieEfestoCommonException("Wrong file name " + fileName);
        }
        String model = getModel(fileName);
        if (model.isEmpty()) {
            throw new KieEfestoCommonException("Wrong file name " + fileName);
        }
        return toValidate;
    }
@Test
    void validateWrongPathName() {
        String toValidate1 = String.format("%1$sthis%1$sis%1$sinvalid%1$sfile._json", File.separator);
        String toValidate2 = String.format("%1$sthis%1$sis%1$sinvalid%1$sfile.model", File.separator);
        final List<String> toValidate = Arrays.asList(toValidate1, toValidate2);
        toValidate.forEach(toVal -> {
            String fileName = toVal.substring(toVal.lastIndexOf(File.separator) + 1);
            String expectedMessage = String.format("Wrong file name %s", fileName);
            assertThatThrownBy(() -> IndexFile.validatePathName(toVal))
                    .isInstanceOf(KieEfestoCommonException.class)
                    .hasMessage(expectedMessage);
        });
    }