I've injected ff4j
following example. Ff4jConfiguration.class
:
@Bean
@ConditionalOnMissingBean
public FF4j getFF4j() {
return new FF4j("ff4j.xml");
}
and application loader was also changed:
@Import( {..., Ff4jConfiguration.class})
@AutoConfigureAfter(Ff4jConfiguration.class)
my ff4j.xml
:
<?xml version="1.0" encoding="UTF-8" ?>
<ff4j xmlns="http://www.ff4j.org/schema/ff4j"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ff4j.org/schema/ff4j http://ff4j.org/schema/ff4j-1.4.0.xsd">
<features>
<feature uid="occurrence-logging" enable="false"/>
<feature uid="check-no-logging" enable="false"/>
<feature uid="check-logging" enable="true"/>
</features>
</ff4j>
My bean to verify ff4j
@Component
public class JustToCheck {
@Autowired
private FF4j ff4j;
@Flip(name="occurrence-logging")
public void log() {
System.out.println("hello");
}
@Flip(name="check-no-logging")
public void log2() {
System.out.println("hello2");
}
@Flip(name="check-logging")
public void log3() {
System.out.println("hello3");
}
}
In runtime I see ff4j
bean injected correctly with correspond properties:
ff4j.check("check-no-logging")
> result=false
ff4j.check("check-logging")
> result=true
I expect method log2
will be never called, but it is (All used methods were called, none ignored). Can someone help me what I've done wrong here please?