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

    https://github.com/apache/metron/pull/871#discussion_r157390830
  
    --- Diff: 
metron-analytics/metron-profiler-client/src/test/java/org/apache/metron/profiler/client/stellar/GetProfileTest.java
 ---
    @@ -310,6 +306,36 @@ public void testOutsideTimeHorizon() {
         Assert.assertEquals(0, result.size());
       }
     
    +  /**
    +   * Default value should be able to be specified
    +   */
    +  @Test
    +  public void testWithDefaultValue() {
    +    String expr = "PROFILE_GET('profile1', 'entity1', PROFILE_FIXED(4, 
'HOURS'))";
    +    @SuppressWarnings("unchecked")
    +    List<Integer> result = run(expr, List.class);
    +
    +    // validate - expect to fail to read any values because we didn't 
write any.
    +    Assert.assertEquals(0, result.size());
    +
    +    // execute - read the profile values - with config_override.
    +    // first two override values are strings, third is deliberately a 
number.
    +    testOverride("{'profiler.default.value' : 0}", 0);
    +    testOverride("{'profiler.default.value' : 'metron'}", "metron");
    +    testOverride("{'profiler.default.value' : []}", new ArrayList<>());
    +  }
    +
    +  private void testOverride(String overrides, Object defaultVal) {
    +      String expr = "PROFILE_GET('profile1', 'entity1', PROFILE_FIXED(4, 
'HOURS'), [], " + overrides + ")"
    +      ;
    --- End diff --
    
    Small nit... semi on a new line?


---

Reply via email to