PluginImpl.getInstance().addServer(gerritServer);
gerritServer.start();
FreeStyleProject project = DuplicatesUtil.createGerritTriggeredJob(j, projectName, gerritServerName);
GerritTriggerApi api = new GerritTriggerApi();
Handler handler = null;
try {
handler = api.getHandler();
} catch (GerritTriggerException ex) {
fail(ex.getMessage());
}
assertNotNull(handler);
handler.post(Setup.createPatchsetCreated(gerritServerName));
TestUtils.waitForBuilds(project, 1);
FreeStyleBuild buildOne = project.getLastCompletedBuild();
assertSame(Result.SUCCESS, buildOne.getResult());
assertEquals(1, project.getLastCompletedBuild().getNumber());