Search in sources :

Example 1 with BootstrapSecurityStore

use of org.eclipse.leshan.server.security.BootstrapSecurityStore in project leshan by eclipse.

the class LeshanBootstrapServerBuilderTest method create_server_with_securityStore.

@Test
public void create_server_with_securityStore() {
    builder.setSecurityStore(new BootstrapSecurityStore() {

        @Override
        public SecurityInfo getByIdentity(String pskIdentity) {
            return null;
        }

        @Override
        public List<SecurityInfo> getAllByEndpoint(String endpoint) {
            return null;
        }
    });
    server = builder.build();
    assertNotNull(server.getSecuredAddress());
    assertNotNull(server.getUnsecuredAddress());
    assertNotNull(server.getBootstrapSecurityStore());
}
Also used : BootstrapSecurityStore(org.eclipse.leshan.server.security.BootstrapSecurityStore) List(java.util.List) SecurityInfo(org.eclipse.leshan.server.security.SecurityInfo) Test(org.junit.Test)

Example 2 with BootstrapSecurityStore

use of org.eclipse.leshan.server.security.BootstrapSecurityStore in project leshan by eclipse.

the class LeshanBootstrapServerBuilderTest method create_server_with_securityStore_and_disable_secured_endpoint.

@Test
public void create_server_with_securityStore_and_disable_secured_endpoint() {
    builder.setSecurityStore(new BootstrapSecurityStore() {

        @Override
        public SecurityInfo getByIdentity(String pskIdentity) {
            return null;
        }

        @Override
        public List<SecurityInfo> getAllByEndpoint(String endpoint) {
            return null;
        }
    });
    builder.disableSecuredEndpoint();
    server = builder.build();
    assertNull(server.getSecuredAddress());
    assertNotNull(server.getUnsecuredAddress());
}
Also used : BootstrapSecurityStore(org.eclipse.leshan.server.security.BootstrapSecurityStore) List(java.util.List) SecurityInfo(org.eclipse.leshan.server.security.SecurityInfo) Test(org.junit.Test)

Example 3 with BootstrapSecurityStore

use of org.eclipse.leshan.server.security.BootstrapSecurityStore in project leshan by eclipse.

the class LeshanBootstrapServerBuilderTest method create_server_with_securityStore_and_disable_unsecured_endpoint.

@Test
public void create_server_with_securityStore_and_disable_unsecured_endpoint() {
    builder.setSecurityStore(new BootstrapSecurityStore() {

        @Override
        public SecurityInfo getByIdentity(String pskIdentity) {
            return null;
        }

        @Override
        public List<SecurityInfo> getAllByEndpoint(String endpoint) {
            return null;
        }
    });
    builder.disableUnsecuredEndpoint();
    server = builder.build();
    assertNotNull(server.getSecuredAddress());
    assertNull(server.getUnsecuredAddress());
}
Also used : BootstrapSecurityStore(org.eclipse.leshan.server.security.BootstrapSecurityStore) List(java.util.List) SecurityInfo(org.eclipse.leshan.server.security.SecurityInfo) Test(org.junit.Test)

Aggregations

List (java.util.List)3 BootstrapSecurityStore (org.eclipse.leshan.server.security.BootstrapSecurityStore)3 SecurityInfo (org.eclipse.leshan.server.security.SecurityInfo)3 Test (org.junit.Test)3