@Service
public interface DatabaseConnector {
public Model getModel();
}
@Configuration
@Profile({"!test"})
public class DatabaseConnectorT implements DatabaseConnector {
private final Model model;
@Autowired
public DatabaseConnectorT(@Value("${assemblerFile}") String assemblerFile) {
model = TDBFactory.assembleModel(assemblerFile);
}
}
I am getting the error, that this bean class cannot be instantiated and a default constructor should be given. Why should such one be required? I have two different implementations of the interface which should be loaded dependent on the active profile. Configuration should be done with annotations.