@Test
public void checkCreationFeatureByMessageMethodBasedOnJsonFile()
        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(
            "{\n" +
                    "  \"repositories\": [\n" +
                    "    {\n" +
                    "      \"repositoryId\": \"repository1\",\n" +
                    "      \"type\": \"default\",\n" +
                    "      \"url\": \"info.smart_tools.smartactors\"\n" +
                    "    }\n" +
                    "  ],\n" +
                    "  \"features\": [\n" +
                    "    {\n" +
                    "      \"name\": \"feature1\",\n" +
                    "      \"group\": \"info.smart_tools.smartactors\",\n" +
                    "      \"version\": \"0.0.0\"\n" +
                    "    }\n" +
                    "  ]\n" +
                    "}"
    );
    when(wrapper.getRepositoriesDescription()).thenReturn(
            (List<IObject>) json.getValue(new FieldName("repositories"))
    );
    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(), "feature1");
    assertEquals(((IFeature) features.toArray()[0]).getGroupId(), "info.smart_tools.smartactors");
    assertEquals(((IFeature) features.toArray()[0]).getVersion(), "0.0.0");
}