use of com.hazelcast.config.RestApiConfig in project hazelcast by hazelcast.
the class RestLogLevelTest method createReadOnlyConfig.
protected Config createReadOnlyConfig() {
Config config = createConfig();
RestApiConfig restApiConfig = new RestApiConfig().setEnabled(true).enableGroups(RestEndpointGroup.CLUSTER_READ).disableGroups(RestEndpointGroup.CLUSTER_WRITE);
config.getNetworkConfig().setRestApiConfig(restApiConfig);
return config;
}
use of com.hazelcast.config.RestApiConfig in project hazelcast by hazelcast.
the class RestNodeStateTest method testStartingNodeState_regression.
/**
* This test does a node-state REST call before the Node is switched to the {@link NodeState#ACTIVE}. A custom discovery
* strategy is used to block the processing in a point when REST is already running, but the node is not yet active. During
* the blocked discovery initialization the HTTP call is done.
* <p>
* See
* <a href="https://github.com/hazelcast/hazelcast/issues/17773">https://github.com/hazelcast/hazelcast/issues/17773</a>.
*/
@Test
public void testStartingNodeState_regression() throws Exception {
Config config = smallInstanceConfig().setProperty(ClusterProperty.DISCOVERY_SPI_ENABLED.getName(), "true");
RestApiConfig restApiConfig = new RestApiConfig().setEnabled(true).enableAllGroups();
NetworkConfig networkConfig = config.getNetworkConfig();
int port = TestUtil.getAvailablePort(BASE_PORT);
networkConfig.setPort(port).setPortAutoIncrement(false);
networkConfig.getJoin().getMulticastConfig().setEnabled(false);
networkConfig.setRestApiConfig(restApiConfig);
StrategyFactory discoveryStrategyFactory = new StrategyFactory();
networkConfig.getJoin().getDiscoveryConfig().addDiscoveryStrategyConfig(new DiscoveryStrategyConfig(discoveryStrategyFactory));
HazelcastTestSupport.spawn(() -> Hazelcast.newHazelcastInstance(config));
discoveryStrategyFactory.getNodeStartingLatch().await();
HTTPCommunicator communicator = new HTTPCommunicator(port);
assertEquals("\"STARTING\"", communicator.getClusterHealth("/node-state"));
discoveryStrategyFactory.getTestDoneLatch().countDown();
}
use of com.hazelcast.config.RestApiConfig in project hazelcast by hazelcast.
the class RestCPSubsystemTest method setup.
@Before
public void setup() {
RestApiConfig restApiConfig = new RestApiConfig().setEnabled(true).enableGroups(RestEndpointGroup.CP);
config.getNetworkConfig().setRestApiConfig(restApiConfig);
JoinConfig join = config.getNetworkConfig().getJoin();
join.getMulticastConfig().setEnabled(false);
join.getTcpIpConfig().setEnabled(true).clear().addMember("127.0.0.1");
config.getCPSubsystemConfig().setCPMemberCount(3);
}
use of com.hazelcast.config.RestApiConfig in project hazelcast by hazelcast.
the class WanOpenSourceAntiEntropyMcEventsTest method getConfigWithRest.
private Config getConfigWithRest() {
Config config = smallInstanceConfig();
RestApiConfig restApiConfig = config.getNetworkConfig().getRestApiConfig();
restApiConfig.setEnabled(true);
restApiConfig.enableGroups(RestEndpointGroup.WAN);
JoinConfig joinConfig = config.getNetworkConfig().getJoin();
joinConfig.getMulticastConfig().setEnabled(false);
joinConfig.getTcpIpConfig().setEnabled(true).addMember("127.0.0.1");
return config;
}
Aggregations