[ https://issues.apache.org/jira/browse/NIFI-1838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15334699#comment-15334699 ]
ASF GitHub Bot commented on NIFI-1838: -------------------------------------- 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. > Groovy Test Scripts will require refactoring if we implement NIFI-1152 > ---------------------------------------------------------------------- > > Key: NIFI-1838 > URL: https://issues.apache.org/jira/browse/NIFI-1838 > Project: Apache NiFi > Issue Type: Bug > Components: Core Framework > Affects Versions: 1.0.0, 0.6.1 > Reporter: Puspendu Banerjee > Labels: patch > Fix For: 1.0.0 > > Attachments: > 0001-Fix-for-NIFI-1838-NIFI-1152-Code-modification-for-ty.patch > > > Groovy Test Scripts will require refractoring we implement NIFI-1152 as they > don't define Relationships properly -- This message was sent by Atlassian JIRA (v6.3.4#6332)