Browse Source
Merge pull request #12725 from YevhenBondarenko/fix/coap-config
Fix CoAP enabled properties
pull/12751/head
Viacheslav Klimov
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with
8 additions and
7 deletions
-
application/src/main/resources/thingsboard.yml
-
application/src/test/java/org/thingsboard/server/transport/coap/AbstractCoapIntegrationTest.java
-
application/src/test/java/org/thingsboard/server/transport/coap/security/AbstractCoapSecurityIntegrationTest.java
-
application/src/test/resources/application-test.properties
-
common/coap-server/src/main/java/org/thingsboard/server/coapserver/TbCoapServerComponent.java
-
common/coap-server/src/main/java/org/thingsboard/server/coapserver/TbCoapTransportComponent.java
|
|
|
@ -1279,8 +1279,9 @@ transport: |
|
|
|
|
|
|
|
# CoAP server parameters |
|
|
|
coap: |
|
|
|
# Enable/disable coap server. |
|
|
|
enabled: "${COAP_SERVER_ENABLED:true}" |
|
|
|
server: |
|
|
|
# Enable/disable coap server. |
|
|
|
enabled: "${COAP_SERVER_ENABLED:true}" |
|
|
|
# CoAP bind address |
|
|
|
bind_address: "${COAP_BIND_ADDRESS:0.0.0.0}" |
|
|
|
# CoAP bind port |
|
|
|
|
|
|
|
@ -45,7 +45,7 @@ import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
@TestPropertySource(properties = { |
|
|
|
"coap.enabled=true", |
|
|
|
"coap.server.enabled=true", |
|
|
|
"service.integrations.supported=ALL", |
|
|
|
"transport.coap.enabled=true", |
|
|
|
}) |
|
|
|
|
|
|
|
@ -61,7 +61,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@TestPropertySource(properties = { |
|
|
|
"coap.enabled=true", |
|
|
|
"coap.server.enabled=true", |
|
|
|
"coap.dtls.enabled=true", |
|
|
|
"coap.dtls.credentials.pem.cert_file=coap/credentials/server/cert.pem", |
|
|
|
"device.connectivity.coaps.enabled=true", |
|
|
|
|
|
|
|
@ -19,7 +19,7 @@ transport.mqtt.enabled=false |
|
|
|
transport.coap.enabled=false |
|
|
|
transport.lwm2m.enabled=false |
|
|
|
transport.snmp.enabled=false |
|
|
|
coap.enabled=false |
|
|
|
coap.server.enabled=false |
|
|
|
integrations.rpc.enabled=false |
|
|
|
service.integrations.supported=NONE |
|
|
|
|
|
|
|
|
|
|
|
@ -21,6 +21,6 @@ import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ConditionalOnExpression("'${service.type:null}'=='tb-transport' || ('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${coap.enabled}'=='true')") |
|
|
|
@ConditionalOnExpression("'${service.type:null}'=='tb-transport' || ('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${coap.server.enabled}'=='true')") |
|
|
|
public @interface TbCoapServerComponent { |
|
|
|
} |
|
|
|
|
|
|
|
@ -22,6 +22,6 @@ import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ConditionalOnExpression("'${service.type:null}'=='tb-transport' || " + |
|
|
|
"('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${coap.enabled}'=='true' && '${transport.coap.enabled}'=='true')") |
|
|
|
"('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${coap.server.enabled}'=='true' && '${transport.coap.enabled}'=='true')") |
|
|
|
public @interface TbCoapTransportComponent { |
|
|
|
} |
|
|
|
|