Try this
@Service
public class ServiceAImpl implements ServiceA {
private final String fieldA;
@Autowire
public ServiceAImpl(@Value("${fieldA}") String fieldA){
this.fieldA = fieldA;
}
@Override
public boolean isFieldA(String text){
return fieldA.equals(text);
}
}
and this
@EnableSwagger2
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
You should not use @Service
and @Bean
for the same class!