Rohit Bajaj
asked on
Instantiating a class without constructor and with @Value annotation for Junit
Hi,
I want to make a Bean in context of my Junit code of a spring web application. Here is the class in the project that i want to instantiate.
This has no constructor and also uses @Value annotation. How to do it.
Thanks
I want to make a Bean in context of my Junit code of a spring web application. Here is the class in the project that i want to instantiate.
This has no constructor and also uses @Value annotation. How to do it.
@Service
public class AppEnvironment {
@Value("${app.appId}")
private String appId;
@Value("${app.appSecret}")
private String appSecret;
@Value("${app.isProd}")
private boolean isProd;
@Value("${app.baseUrl}")
private String baseUrl;
@Value("${app.botId}")
private String botGUID;
@Value("${app.botToken}")
private String botToken;
@Value("${app.iconUrl}")
private String appIconUrl;
private String fontColor;
@Value("${app.notificationHostname}")
private String reminderBotHost;
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This is a perfectly valid answer.