@SuppressWarnings("unchecked")
    public static KiePMMLModelFactory loadKiePMMLModelFactory(ModelLocalUriId modelLocalUriId,
                                                              PMMLContext pmmlContext) {
        Optional<GeneratedExecutableResource> generatedExecutableResource = getGeneratedExecutableResource(modelLocalUriId, pmmlContext.getGeneratedResourcesMap());
        if (generatedExecutableResource.isPresent()) {
            return loadKiePMMLModelFactory(generatedExecutableResource.get(), pmmlContext);
        } else {
            throw new KieRuntimeServiceException("Can not find expected GeneratedExecutableResource " +
                                                             "for " + modelLocalUriId);
        }
    }
@Test
    void loadNotExistingKiePMMLModelFactory() {
        try {
            PMMLLoaderUtils.loadKiePMMLModelFactory(new ModelLocalUriId(LocalUri.parse("/notpmml/" + basePath)), getPMMLContext(FILE_NAME,
                                                                                                           MODEL_NAME));
            fail("Expecting KieRuntimeServiceException");
        } catch (Exception e) {
            assertThat(e).isInstanceOf(KieRuntimeServiceException.class);
        }
    }