@Test
public void Should_loadFeatureGroup_loadFeaturesFromDirectory()
        throws Exception {

    IPath groupPathMock = mock(IPath.class);
    IPath featurePathMock = mock(IPath.class);
    IPath featureConfigPathMock = mock(IPath.class);
    when(filesystemFacadeMock.listSubdirectories(same(groupPathMock))).thenReturn(Collections.singletonList(featurePathMock));
    when(filesystemFacadeMock.joinPaths(same(featurePathMock), eq(new Path("config.json")))).thenReturn(featureConfigPathMock);
    when(featureConfigurationMock1.getValue(featureNameFN)).thenReturn("feature1");
    when(featureConfigurationMock1.getValue(afterFeaturesFN)).thenReturn(Collections.emptyList());
    //noinspection unchecked
    when(IOC.resolve(same(iobjectKey)))
            .thenReturn(metafeatureConfigMock)
            .thenThrow(ResolutionException.class);
    //noinspection unchecked
    when(IOC.resolve(same(featureStatusKey), any(), any()))
            .thenReturn(featureStatusMock1)
            .thenReturn(featureStatusMock2)
            .thenThrow(ResolutionException.class);
    //noinspection unchecked
    when(IOC.resolve(same(configurationObjectKey), any()))
            .thenReturn(featureConfigurationMock1)
            .thenReturn(featureConfigurationMock2)
            .thenThrow(ResolutionException.class);
    //noinspection unchecked
    when(IOC.resolve(same(pluginLoaderKey), any(), any(), any()))
            .thenReturn(pluginLoaderMock)
            .thenReturn(pluginLoaderMock)
            .thenThrow(ResolutionException.class);
    doAnswer(invocationOnMock -> {
        when(featureStatusMock2.isInitialized()).thenReturn(true);
        return null;
    }).when(featureStatusMock2).init(any(), any());
    FeatureLoader featureLoader = new FeatureLoader();
    IFeatureStatus status = featureLoader.loadGroup(groupPathMock);
    assertSame(featureStatusMock1, status);
}