Comments (5)
Hum... is it a trick from the mongodb-driver returning different BSONList if the list is empty ? I'm pretty sure to test this behaviour if roles are set.
Well I would like to cast to the common upper class "BSONObject" but it's not iterable.... I will have to use the ugly (instanceof ?) beurk...
from ff4j.
Well, cannot reproduce this one (Mongodb v2.6.3, MongoDriver v2.12.2)
db.feature.find({"_id":"AwesomeFeature"}).pretty();
{ "_id" : "AwesomeFeature", "enable" : true, "description" : "some desc", "groupname" : null, "strategy" : null, "expression" : null, "roles" : [ ] }
Test passing (no exception at least)
// Given MongoCredential credential = MongoCredential.createMongoCRCredential("xx", "yyy", "xxx".toCharArray()); ServerAddress adr = new ServerAddress("localhost", 22012); MongoClient mongoClient = new MongoClient(adr, Arrays.asList(credential)); DBCollection features = mongoClient.getDB( "FF4J" ).getCollection("feature"); // When FeatureStore mongoStore = new FeatureStoreMongoDB(features, "ff4j.xml"); Feature f = mongoStore.read("AwesomeFeature");
still investigate...
from ff4j.
Hum... I'm using the same versions
I made a little patch for my purpose and I just check the existence of the field in mapAuthorization method (FeatureDBObjectMapper.java)
if (dbObject.containsField(ROLES)) {
for (Object role : (Iterable) dbObject.get(ROLES)) {
authorisation.add(role.toString());
}
}
Could you check with a null value instead of an empty value ?
(I'm sorry, I'm not on this bug right now, I'll try again and I'll give you more informations)
from ff4j.
I also test with the null value and same result. The test for existence was already there but casting as Iterable is a good enough solution work in all cases. I will go this way.
from ff4j.
Corrected in 1.3.1 with the iterable trick
from ff4j.
Related Issues (20)
- [Bug] Mockito-core as compile dependency of ff4j-core
- ff4j-config-yaml doesn't support snakeyaml 2.0 HOT 1
- YamlParser is not exporting property description [Bug]
- YamlParser should not print configuration to the standard out when export is called
- Support Redis client side caching
- Thymeleaf deprecation warnings
- [Bug] FF4J is using SimpleDateFormat which is not thread safe HOT 3
- Support environmental variables for dynamo db client
- [Bug]Accessing the rest api? HOT 4
- [Bug] Using a pooling data source (example PoolingDataSourceImpl) with audit enabled, after you create a property you cannot update it HOT 1
- how to pass custom parameters to custom flip strategy HOT 2
- Ff4j client with spring boot 3.x HOT 8
- Notification of toggle activation/decativation over communication channels HOT 2
- [Bug] org.ff4j ยป ff4j-spring-boot-starter 2.0.0 is not available in maven central HOT 3
- How can I customize the ui of web console including logo and header ? HOT 1
- Upgrade from 1.8.12 to 1.8.13 Breaks Deployment of War to WebSphere
- Feature toggle state change evicts from cache but doesn't cache new state HOT 1
- [New Feature] Jedis 4 compatibility
- [New Feature] PostgreSQL compatibility HOT 2
- [Bug] Can I set Web Console content path to "/" ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ff4j.