daria-malkova commented on a change in pull request #16273:
URL: https://github.com/apache/beam/pull/16273#discussion_r771499741
##########
File path: playground/backend/internal/preparators/java_preparators_test.go
##########
@@ -108,3 +110,40 @@ func TestGetJavaPreparators(t *testing.T) {
})
}
}
+
+func Test_changeJavaTestFileName(t *testing.T) {
+ codeWithPublicClass := "package org.apache.beam.sdk.transforms; \n
public class Class {\n public static void main(String[] args) {\n
System.out.println(\"Hello World!\");\n }\n}"
+ path, err := os.Getwd()
+ if err != nil {
+ panic(err)
+ }
+ lc, _ := fs_tool.NewLifeCycle(pb.Sdk_SDK_JAVA, uuid.New(),
filepath.Join(path, "temp"))
+ _ = lc.CreateFolders()
+ defer os.RemoveAll(filepath.Join(path, "temp"))
+ _, _ = lc.CreateSourceCodeFile(codeWithPublicClass)
+ validationResults := sync.Map{}
+ validationResults.Store(validators.UnitTestValidatorName, true)
+
+ type args struct {
+ args []interface{}
+ }
+ tests := []struct {
+ name string
+ args args
+ wantErr bool
+ }{
+ {
+ // Test that file where package is used changes to
import all dependencies from this package
+ name: "original file with package",
+ args:
args{[]interface{}{lc.GetAbsoluteSourceFilePath(), &validationResults}},
+ wantErr: false,
Review comment:
\+ changed the description
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]