Constants improvement
This commit is contained in:
parent
d109941cf9
commit
38d3b9c293
@ -78,6 +78,7 @@ import java.util.List;
|
|||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
|
||||||
|
import static org.eclipse.leshan.client.object.Security.noSec;
|
||||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||||
|
|
||||||
@DaoSqlTest
|
@DaoSqlTest
|
||||||
@ -160,15 +161,15 @@ public class AbstractLwM2MIntegrationTest extends AbstractWebsocketTest {
|
|||||||
// certificates trustedby the server (should contain rootCA)
|
// certificates trustedby the server (should contain rootCA)
|
||||||
protected final Certificate[] trustedCertificates = new Certificate[1];
|
protected final Certificate[] trustedCertificates = new Certificate[1];
|
||||||
|
|
||||||
protected final int SECURE_PORT = 5686;
|
protected static final int SECURE_PORT = 5686;
|
||||||
protected final NetworkConfig SECURE_COAP_CONFIG = new NetworkConfig().setString("COAP_SECURE_PORT", Integer.toString(SECURE_PORT));
|
protected static final NetworkConfig SECURE_COAP_CONFIG = new NetworkConfig().setString("COAP_SECURE_PORT", Integer.toString(SECURE_PORT));
|
||||||
protected final String SECURE_ENDPOINT = "deviceAEndpoint";
|
protected static final String SECURE_ENDPOINT = "deviceAEndpoint";
|
||||||
protected final String SECURE_URI = "coaps://localhost:" + SECURE_PORT;
|
protected static final String SECURE_URI = "coaps://localhost:" + SECURE_PORT;
|
||||||
|
|
||||||
private final int PORT = 5686;
|
protected static final int PORT = 5685;
|
||||||
private final NetworkConfig COAP_CONFIG = new NetworkConfig().setString("COAP_SECURE_PORT", Integer.toString(PORT));
|
protected static final Security SECURITY = noSec("coap://localhost:" + PORT, 123);
|
||||||
private final String ENDPOINT = "deviceAEndpoint";
|
protected static final NetworkConfig COAP_CONFIG = new NetworkConfig().setString("COAP_PORT", Integer.toString(PORT));
|
||||||
private final String SERVER_URI = "coaps://localhost:" + PORT;
|
protected static final String ENDPOINT = "deviceAEndpoint";
|
||||||
|
|
||||||
public AbstractLwM2MIntegrationTest() {
|
public AbstractLwM2MIntegrationTest() {
|
||||||
// create client credentials
|
// create client credentials
|
||||||
|
|||||||
@ -15,20 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.thingsboard.server.transport.lwm2m;
|
package org.thingsboard.server.transport.lwm2m;
|
||||||
|
|
||||||
import org.eclipse.californium.core.network.config.NetworkConfig;
|
|
||||||
import org.eclipse.leshan.client.object.Security;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.thingsboard.server.common.data.device.credentials.lwm2m.NoSecClientCredentials;
|
import org.thingsboard.server.common.data.device.credentials.lwm2m.NoSecClientCredentials;
|
||||||
|
|
||||||
import static org.eclipse.leshan.client.object.Security.noSec;
|
|
||||||
|
|
||||||
public class NoSecLwM2MIntegrationTest extends AbstractLwM2MIntegrationTest {
|
public class NoSecLwM2MIntegrationTest extends AbstractLwM2MIntegrationTest {
|
||||||
|
|
||||||
private final int PORT = 5685;
|
|
||||||
private final Security SECURITY = noSec("coap://localhost:" + PORT, 123);
|
|
||||||
private final NetworkConfig COAP_CONFIG = new NetworkConfig().setString("COAP_PORT", Integer.toString(PORT));
|
|
||||||
private final String ENDPOINT = "deviceAEndpoint";
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testConnectAndObserveTelemetry() throws Exception {
|
public void testConnectAndObserveTelemetry() throws Exception {
|
||||||
NoSecClientCredentials clientCredentials = new NoSecClientCredentials();
|
NoSecClientCredentials clientCredentials = new NoSecClientCredentials();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user