using ConfigurationProperties in test

I have an ApplicationProperties that i use it in my service. When i mock the rest template in my test to test that service it results in java.lang.NullPointerException, when i replace applicationProperties.getBebusiness().getEndPointProvider() with the url, the test passes @Configuration @ConfigurationProperties(prefix = “application”, ignoreUnknownFields = false) public class ApplicationProperties { … } @Service public class ProviderServiceImpl…

Details

How can I resolve this issue on SonarCloud?

Using SonarCloud I got this bug: Use try-with-resources or close this “ResultSet” in a “finally” clause This is the following code: public long executeUpdate() throws SQLException { if (query != null) { try { statement.execute(); if (returnGeneratedKeys) { ResultSet resultSet = statement.getGeneratedKeys(); if (resultSet.next()) { return resultSet.getLong(1); } } } finally { statement.close(); connection.close(); }…

Details

Unable to make actuator endpoints working in a legacy Spring boot project – getting authentication page

Spring boot actuator is already included in the POM, and it shows in the startup logs. However, when I try to access /actuator or even the base url of my project, I get the following – { “timestamp”: 1577096144986, “status”: 401, “error”: “Unauthorized”, “message”: “Full authentication is required to access this resource”, “path”: “/actuator” }…

Details