in your @SpringBootTest Annotation you can pass properties to override the actual ones like the following
@SpringBootTest(properties = {"spring.data.mongodb.username=","spring.data.mongodb.password="})
You can review this article for more infos/options https://www.baeldung.com/spring-tests-override-properties