Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/595#discussion_r28544130
  
    --- Diff: core/src/test/java/brooklyn/enricher/EnrichersTest.java ---
    @@ -431,4 +435,45 @@ protected void doUpdatingMapChecks(AttributeSensor 
mapSensor) {
             EntityTestUtils.assertAttributeEqualsEventually(entity, mapSensor, 
MutableMap.<String,String>of());
         }
     
    +    private static AttributeSensor<Object> LIST_SENSOR = 
Sensors.newSensor(Object.class, "sensor.list");
    +    
    +    @Test
    +    public void testJoinerDefault() {
    +        entity.addEnricher(Enrichers.builder()
    +                .joining(LIST_SENSOR)
    +                .publishing(TestEntity.NAME)
    +                .build());
    +        // null values ignored, and it quotes
    +        entity.setAttribute(LIST_SENSOR, MutableList.<String>of("a", 
"\"b").append(null));
    +        EntityTestUtils.assertAttributeEqualsEventually(entity, 
TestEntity.NAME, "\"a\",\"\\\"b\"");
    +        
    +        // empty list causes ""
    +        entity.setAttribute(LIST_SENSOR, 
MutableList.<String>of().append(null));
    +        EntityTestUtils.assertAttributeEqualsEventually(entity, 
TestEntity.NAME, "");
    +        
    +        // null causes null
    +        entity.setAttribute(LIST_SENSOR, null);
    +        EntityTestUtils.assertAttributeEqualsEventually(entity, 
TestEntity.NAME, null);
    +    }
    +
    +    
    +    @Test
    +    public void testJoinerUnquoted() {
    --- End diff --
    
    Need more tests (e.g. that minimum/maximum are respected - when list length 
is increasing and when it's decreasing, etc).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to