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

    https://github.com/apache/nifi/pull/2983#discussion_r218085671
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/groovy/org/apache/nifi/security/util/crypto/HashServiceTest.groovy
 ---
    @@ -0,0 +1,457 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License") you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.nifi.security.util.crypto
    +
    +import org.apache.nifi.components.AllowableValue
    +import org.bouncycastle.jce.provider.BouncyCastleProvider
    +import org.bouncycastle.util.encoders.Hex
    +import org.junit.After
    +import org.junit.AfterClass
    +import org.junit.Before
    +import org.junit.BeforeClass
    +import org.junit.Test
    +import org.junit.runner.RunWith
    +import org.junit.runners.JUnit4
    +import org.slf4j.Logger
    +import org.slf4j.LoggerFactory
    +
    +import java.nio.charset.Charset
    +import java.nio.charset.StandardCharsets
    +import java.security.Security
    +
    +@RunWith(JUnit4.class)
    +class HashServiceTest extends GroovyTestCase {
    +    private static final Logger logger = 
LoggerFactory.getLogger(HashServiceTest.class)
    +    static private final String LARGE_FILE_PATH = 
"src/test/resources/HashServiceTest/largefile.txt"
    --- End diff --
    
    This is minor, but this path could be changed to be located in a sub-dir of 
`target` instead of `src`, which would have the following advantages:
    
    - would not need to be generated every time the tests are run and would not 
need to be manually removed, as it be destroyed only on a `mvn clean`
    - would not show up as a git untracked file, as everything under `target` 
is ignored
    - would not be scanned but the Apache RAT plugin (IIRC, it does not scan 
`target`?)
    - would not require the `.keep` file to maintain a directory if you put it 
in a directory that you expect the build to generate, ie `target/test-classes`
    
    I know that most of these are mitigated by the removal of the file in the 
`tearDownOnce()` method, but should the execution / JVM halt for any reason 
prior to that method executing (could be more likely in a multi-threaded build 
due to errors in other tests), then there is a chance that the generated file 
remains in the src directory and could create confusion / unintended 
consequences if followed by something like a `git add -A` command.
    
    Like I said, this is a minor nitpick, not a blocker by any means :)


---

Reply via email to