diff --git a/src/main/java/org/jenkinsci/pipeline_steps_doc_generator/ToAsciiDoc.java b/src/main/java/org/jenkinsci/pipeline_steps_doc_generator/ToAsciiDoc.java index b9a8d1f..d53b8c4 100644 --- a/src/main/java/org/jenkinsci/pipeline_steps_doc_generator/ToAsciiDoc.java +++ b/src/main/java/org/jenkinsci/pipeline_steps_doc_generator/ToAsciiDoc.java @@ -75,7 +75,7 @@ public ToAsciiDoc(HyperLocalPluginManager pluginManager) { .getByPlugin().entrySet()) { ExtensionList descriptors = ExtensionList.lookup(Descriptor.class); for (Descriptor d: descriptors) { - if (d.getClass().getName() == entry.getKey()) { + if (entry.getKey().equals(d.getClass().getName())) { map.put(d.clazz.getName(), entry.getValue()); } } @@ -403,7 +403,7 @@ public String generatePluginHelp( Map> byPlugin, boolean isDeprecated, boolean genHeader) { - Main.isUnitTest = true; + setUnitTest(); // TODO: if condition StringBuilder whole9yards = new StringBuilder(); @@ -427,9 +427,13 @@ public String generatePluginHelp( return whole9yards.toString(); } + private static void setUnitTest() { + Main.isUnitTest = true; + } + public String generateDirectiveHelp( String directiveName, Map> descsByPlugin, boolean genHeader) { - Main.isUnitTest = true; + setUnitTest(); StringBuilder whole9yards = new StringBuilder(); if (genHeader) { whole9yards.append(generateHeader(directiveName));