Source:
public void testWithAnInvalidSection ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey p1 = createProject ( "a" ) ; com.google.gerrit.reviewdb.client.Project.NameKey p2 = createProject ( "b" ) ; com.google.gerrit.reviewdb.client.Project.NameKey p3 = createProject ( "d" ) ; com.google.gerrit.reviewdb.client.Project.NameKey p4 = createProject ( "e" ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.fromText ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "\n" + ( ( "[submodule \"a\"]\n" + " path = a\n" ) + " url = ssh://localhost/" ) ) + ( p1.get ( ) ) ) + "\n" ) + " branch = .\n" ) + "[submodule \"b\"]\n" ) + " url = http://localhost:80/" ) + ( p2.get ( ) ) ) + "\n" ) + " branch = master\n" ) + "[submodule \"c\"]\n" ) + " path = c\n" ) + " branch = .\n" ) + "[submodule \"d\"]\n" ) + " path = d-parent/the-d-folder\n" ) + " url = ssh://localhost/" ) + ( p3.get ( ) ) ) + "\n" ) + "[submodule \"e\"]\n" ) + " path = e\n" ) + " url = ssh://localhost/" ) + ( p4.get ( ) ) ) + "\n" ) + " branch = refs/heads/master\n" ) ) ; java.lang.String thisServer = com.google.gerrit.acceptance.git.SubmoduleSectionParserIT.THIS_SERVER ; com.google.gerrit.reviewdb.client.Branch.NameKey targetBranch = new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) , "master" ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > res = new com.google.gerrit.server.util.SubmoduleSectionParser ( projectCache , cfg , thisServer , targetBranch ) . parseAllSections ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > expected = com.google.common.collect.Sets.newHashSet ( new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( targetBranch , new com.google.gerrit.reviewdb.client.Branch.NameKey ( p1 , "master" ) , "a" ) , new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( targetBranch , new com.google.gerrit.reviewdb.client.Branch.NameKey ( p4 , "master" ) , "e" ) ) ; com.google.common.truth.Truth.assertThat ( res ) . containsExactlyElementsIn ( expected ) ; }

Target:
public void testWithAnInvalidSection ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey p1 = createProject ( "a" ) ; com.google.gerrit.reviewdb.client.Project.NameKey p2 = createProject ( "b" ) ; com.google.gerrit.reviewdb.client.Project.NameKey p3 = createProject ( "d" ) ; com.google.gerrit.reviewdb.client.Project.NameKey p4 = createProject ( "e" ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.fromText ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "\n" + ( ( "[submodule \"a\"]\n" + " path = a\n" ) + " url = ssh://localhost/" ) ) + ( p1.get ( ) ) ) + "\n" ) + " branch = .\n" ) + "[submodule \"b\"]\n" ) + " url = http://localhost:80/" ) + ( p2.get ( ) ) ) + "\n" ) + " branch = master\n" ) + "[submodule \"c\"]\n" ) + " path = c\n" ) + " branch = .\n" ) + "[submodule \"d\"]\n" ) + " path = d-parent/the-d-folder\n" ) + " url = ssh://localhost/" ) + ( p3.get ( ) ) ) + "\n" ) + "[submodule \"e\"]\n" ) + " path = e\n" ) + " url = ssh://localhost/" ) + ( p4.get ( ) ) ) + "\n" ) + " branch = refs/heads/master\n" ) ) ; com.google.gerrit.reviewdb.client.Branch.NameKey targetBranch = new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) , "master" ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > res = new com.google.gerrit.server.util.SubmoduleSectionParser ( projectCache , cfg , com.google.gerrit.acceptance.git.SubmoduleSectionParserIT.THIS_SERVER , targetBranch ) . parseAllSections ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > expected = com.google.common.collect.Sets.newHashSet ( new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( targetBranch , new com.google.gerrit.reviewdb.client.Branch.NameKey ( p1 , "master" ) , "a" ) , new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( targetBranch , new com.google.gerrit.reviewdb.client.Branch.NameKey ( p4 , "master" ) , "e" ) ) ; com.google.common.truth.Truth.assertThat ( res ) . containsExactlyElementsIn ( expected ) ; }