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

    https://github.com/apache/nifi/pull/534#discussion_r67424962
  
    --- Diff: 
nifi-mock/src/test/java/org/apache/nifi/util/TestMockProcessSession.java ---
    @@ -55,4 +55,35 @@ public void onTrigger(final ProcessContext ctx, final 
ProcessSession session) th
             }
     
         }
    +
    +
    +    @Test(expected = AssertionError.class)
    +    public void testNonExistentRelationFromProcessor() {
    +        
TestRunners.newTestRunner(NonExistentRelationTestProcessor.class).run();
    +    }
    +
    +    protected static class NonExistentRelationTestProcessor extends 
PoorlyBehavedProcessor {
    +
    +            static final Relationship REL_NON_EXISTENT = new 
Relationship.Builder()
    +                    .name("NonExistent Relation")
    +                    .build();
    +
    +            public Set<Relationship> relationships = 
Collections.singleton(REL_FAILURE);
    +
    +            @Override
    +            public Set<Relationship> getRelationships() {
    +                return relationships;
    --- End diff --
    
    It looks to me this is unrelated. This is a test class absolutely 
independent from scripting processors, you don't need to change the scope of 
the relationship in ``PoorlyBehavedProcessor``and you can return an empty set 
of relationships to execute your unit test.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to