code:     public void testTriggerWithLockedDownInstance() throws Exception {
          FreeStyleProject project = DuplicatesUtil.createGerritTriggeredJob(j, projectName);
  
          Setup.lockDown(j);
  
          GerritTrigger trigger = project.getTrigger(GerritTrigger.class);
          trigger.setSilentStartMode(false);
  
          GerritServer gerritServer = new GerritServer(PluginImpl.DEFAULT_SERVER_NAME);
          SshdServerMock.configureFor(sshd, gerritServer);
          PluginImpl.getInstance().addServer(gerritServer);
          gerritServer.getConfig().setNumberOfSendingWorkerThreads(NUMBEROFSENDERTHREADS);
          ((Config)gerritServer.getConfig()).setGerritAuthKeyFile(sshKey.getPrivateKey());
          gerritServer.start();
  
          gerritServer.triggerEvent(Setup.createPatchsetCreated());
  
          TestUtils.waitForBuilds(project, 1);
          //wait until command is registered
          // CS IGNORE MagicNumber FOR NEXT 2 LINES. REASON: ConstantsNotNeeded
          Thread.sleep(TimeUnit.SECONDS.toMillis(10));
          assertEquals(2, server.getNrCommandsHistory("gerrit review.*"));
  
          FreeStyleBuild buildOne = project.getLastCompletedBuild();
          assertSame(Result.SUCCESS, buildOne.getResult());
          assertEquals(1, project.getLastCompletedBuild().getNumber());
          assertSame(PluginImpl.DEFAULT_SERVER_NAME,
              buildOne.getCause(GerritCause.class).getEvent().getProvider().getName());
  
      }
  