@Test
public void checkCreationFeatureByMessageMethodBasedOnZipFile()
        throws Exception {

    List<IObject> repositoryStorage = new ArrayList<>();
    IOC.register(Keys.getOrAdd("feature-repositories"), new SingletonStrategy(repositoryStorage));
    FeaturesCreatorActor actor = new FeaturesCreatorActor();
    CreateFeaturesWrapper wrapper = mock(CreateFeaturesWrapper.class);
    IObject json = new DSObject(
            "{\"features\": [{\"name\":\"test-feature\",\"version\":null,\"group\":null}]}"
    );
    ((List<IObject>) json.getValue(new FieldName("features"))).get(0).setValue(new FieldName("featureLocation"), new Path("target/test-classes/test-feature-0.0.1-archive.zip"));
    when(wrapper.getFeaturesDescription()).thenReturn(
            (List<IObject>) json.getValue(new FieldName("features"))
    );
    Collection<IFeature> features = new HashSet<>();
    doAnswer(invocationOnMock -> {
        try {
            ((Collection<IFeature>)invocationOnMock.getArguments()[0]).forEach((f) -> {
                features.add(f);
            });
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
        return null;
    }).when(wrapper).setFeatures(any());
    actor.createFeaturesByMessage(wrapper);
    assertEquals(features.size(), 1);
    assertEquals(((IFeature) features.toArray()[0]).getName(), "test-feature");
    assertEquals(((IFeature) features.toArray()[0]).getGroupId(), null);
    assertEquals(((IFeature) features.toArray()[0]).getVersion(), null);
    assertEquals(((IFeature) features.toArray()[0]).getFeatureLocation(), new Path("target/test-classes/test-feature-0.0.1-archive.zip"));
}