@Override
    public Mono<String> generateBundleVersion() {
        if (pluginManager.isDevelopment()) {
            return Mono.just(String.valueOf(clock.instant().toEpochMilli()));
        }
        return Flux.fromIterable(new ArrayList<>(pluginManager.getStartedPlugins()))
            .sort(Comparator.comparing(PluginWrapper::getPluginId))
            .map(pw -> pw.getPluginId() + ':' + pw.getDescriptor().getVersion())
            .collect(Collectors.joining())
            .map(Hashing.sha256()::hashUnencodedChars)
            .map(HashCode::toString);
    }
@Test
    void generateBundleVersionTest() {
        var plugin1 = mock(PluginWrapper.class);
        var plugin2 = mock(PluginWrapper.class);
        var plugin3 = mock(PluginWrapper.class);
        when(pluginManager.getStartedPlugins()).thenReturn(List.of(plugin1, plugin2, plugin3));

        var descriptor1 = mock(PluginDescriptor.class);
        var descriptor2 = mock(PluginDescriptor.class);
        var descriptor3 = mock(PluginDescriptor.class);
        when(plugin1.getDescriptor()).thenReturn(descriptor1);
        when(plugin2.getDescriptor()).thenReturn(descriptor2);
        when(plugin3.getDescriptor()).thenReturn(descriptor3);

        when(plugin1.getPluginId()).thenReturn("fake-1");
        when(plugin2.getPluginId()).thenReturn("fake-2");
        when(plugin3.getPluginId()).thenReturn("fake-3");

        when(descriptor1.getVersion()).thenReturn("1.0.0");
        when(descriptor2.getVersion()).thenReturn("2.0.0");
        when(descriptor3.getVersion()).thenReturn("3.0.0");

        var str = "fake-1:1.0.0fake-2:2.0.0fake-3:3.0.0";
        var result = Hashing.sha256().hashUnencodedChars(str).toString();
        assertThat(result.length()).isEqualTo(64);

        pluginService.generateBundleVersion()
            .as(StepVerifier::create)
            .consumeNextWith(version -> assertThat(version).isEqualTo(result))
            .verifyComplete();

        var plugin4 = mock(PluginWrapper.class);
        var descriptor4 = mock(PluginDescriptor.class);
        when(plugin4.getDescriptor()).thenReturn(descriptor4);
        when(plugin4.getPluginId()).thenReturn("fake-4");
        when(descriptor4.getVersion()).thenReturn("3.0.0");
        var str2 = "fake-1:1.0.0fake-2:2.0.0fake-4:3.0.0";
        var result2 = Hashing.sha256().hashUnencodedChars(str2).toString();
        when(pluginManager.getStartedPlugins()).thenReturn(List.of(plugin1, plugin2, plugin4));
        pluginService.generateBundleVersion()
            .as(StepVerifier::create)
            .consumeNextWith(version -> assertThat(version).isEqualTo(result2))
            .verifyComplete();

        assertThat(result).isNotEqualTo(result2);
    }