I’m trying to write Java unit test in the company’s intranet environment with junit.But when I start the test application,test go wrong.Nacos try to connect to 127.0.0.1:8848 and grpc try to connect to 127.0.0.1:9848.I’m using the same bootstrap.yml as develop environment and this situation didn’t happen in develop environment.
nacos config as below:
spring:
cloud:
nacos:
server-addr:XXXXX:8848
discovery:
service:XXX
config:
server-addr:XXXXX:8848
name:XXX
I add @TestPropertySource(location={"classpath:bootstrap.yml"}
,it doesn’t work.
I also try to use application.yml,and get the same result.
HUI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.