Search in sources :

Example 6 with ClientBwListDTO

use of com.hazelcast.internal.management.dto.ClientBwListDTO in project hazelcast by hazelcast.

the class ClientBwListConfigHandlerTest method testApplyConfig_emptyBlacklist.

@Test
public void testApplyConfig_emptyBlacklist() {
    clientEngine.applySelector(ClientSelectors.none());
    ClientBwListDTO config = createConfig(Mode.BLACKLIST);
    handler.applyConfig(config);
    Client client = createClient("127.0.0.1", "a_name");
    assertTrue(clientEngine.isClientAllowed(client));
}
Also used : Client(com.hazelcast.client.Client) ClientBwListDTO(com.hazelcast.internal.management.dto.ClientBwListDTO) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 7 with ClientBwListDTO

use of com.hazelcast.internal.management.dto.ClientBwListDTO in project hazelcast by hazelcast.

the class ClientBwListConfigHandlerTest method testApplyConfig_nullEntryType_throws.

@Test
public void testApplyConfig_nullEntryType_throws() {
    ClientBwListDTO config = createConfig(Mode.WHITELIST, new ClientBwListEntryDTO(null, "127.0.0.*"));
    assertThrows(NullPointerException.class, () -> handler.applyConfig(config));
}
Also used : ClientBwListEntryDTO(com.hazelcast.internal.management.dto.ClientBwListEntryDTO) ClientBwListDTO(com.hazelcast.internal.management.dto.ClientBwListDTO) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 8 with ClientBwListDTO

use of com.hazelcast.internal.management.dto.ClientBwListDTO in project hazelcast by hazelcast.

the class ClientBwListConfigHandlerTest method testApplyConfig_nullEntryValue_throws.

@Test
public void testApplyConfig_nullEntryValue_throws() {
    ClientBwListDTO config = createConfig(Mode.WHITELIST, new ClientBwListEntryDTO(Type.IP_ADDRESS, null));
    assertThrows(NullPointerException.class, () -> handler.applyConfig(config));
}
Also used : ClientBwListEntryDTO(com.hazelcast.internal.management.dto.ClientBwListEntryDTO) ClientBwListDTO(com.hazelcast.internal.management.dto.ClientBwListDTO) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

ClientBwListDTO (com.hazelcast.internal.management.dto.ClientBwListDTO)8 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)7 QuickTest (com.hazelcast.test.annotation.QuickTest)7 Test (org.junit.Test)7 Client (com.hazelcast.client.Client)5 ClientBwListEntryDTO (com.hazelcast.internal.management.dto.ClientBwListEntryDTO)4 HazelcastException (com.hazelcast.core.HazelcastException)1 ManagementCenterService (com.hazelcast.internal.management.ManagementCenterService)1