### Question:
SupportedProtocolCreator { public ApplicationSupportedProtocols createSupportedRaftProtocol() { return getApplicationSupportedProtocols( config.get( CausalClusteringSettings.raft_implementations ), RAFT ); } SupportedProtocolCreator( Config config, LogProvider logProvider ); ApplicationSupportedProtocols createSupportedCatchupProtocol(); ApplicationSupportedProtocols createSupportedRaftProtocol(); List<ModifierSupportedProtocols> createSupportedModifierProtocols();  }### Answer:
@Test public void shouldReturnRaftProtocol() { Config config = Config.defaults(); ApplicationSupportedProtocols supportedRaftProtocol = new SupportedProtocolCreator( config, log ).createSupportedRaftProtocol(); assertThat( supportedRaftProtocol.identifier(), equalTo( Protocol.ApplicationProtocolCategory.RAFT ) ); }
@Test public void shouldReturnEmptyVersionSupportedRaftProtocolIfNoVersionsConfigured() { Config config = Config.defaults(); ApplicationSupportedProtocols supportedRaftProtocol = new SupportedProtocolCreator( config, log ).createSupportedRaftProtocol(); assertThat( supportedRaftProtocol.versions(), empty() ); }
@Test public void shouldFilterUnknownRaftImplementations() { Config config = Config.defaults( CausalClusteringSettings.raft_implementations, "1, 2, 3" ); ApplicationSupportedProtocols supportedRaftProtocol = new SupportedProtocolCreator( config, log ).createSupportedRaftProtocol(); assertThat( supportedRaftProtocol.versions(), contains( 1, 2 ) ); }
@Test public void shouldReturnConfiguredRaftProtocolVersions() { Config config = Config.defaults( CausalClusteringSettings.raft_implementations, "1" ); ApplicationSupportedProtocols supportedRaftProtocol = new SupportedProtocolCreator( config, log ).createSupportedRaftProtocol(); assertThat( supportedRaftProtocol.versions(), contains( 1 ) ); }
@Test( expected = IllegalArgumentException.class ) public void shouldThrowIfVersionsSpecifiedButAllUnknown() { Config config = Config.defaults( CausalClusteringSettings.raft_implementations, String.valueOf( Integer.MAX_VALUE ) ); ApplicationSupportedProtocols supportedRaftProtocol = new SupportedProtocolCreator( config, log ).createSupportedRaftProtocol(); }