Some people already mentioned it, but for gradle you need to import the test directory to access those "Harness" class files, which are located in the test directory.
Add the "tests" keyword after the library import in the gradle build file.
testImplementation "org.apache.flink:flink-streaming-java:${flinkVersion}:tests"