diff --git a/src/main/java/jenkins/plugins/office365connector/Webhook.java b/src/main/java/jenkins/plugins/office365connector/Webhook.java index e900fd4..f5adcc8 100644 --- a/src/main/java/jenkins/plugins/office365connector/Webhook.java +++ b/src/main/java/jenkins/plugins/office365connector/Webhook.java @@ -16,6 +16,7 @@ import java.util.Collections; import java.util.List; + import edu.umd.cs.findbugs.annotations.NonNull; import hudson.Extension; import hudson.Util; @@ -31,13 +32,10 @@ import org.kohsuke.stapler.DataBoundSetter; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerRequest; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class Webhook extends AbstractDescribableImpl { public static final Integer DEFAULT_TIMEOUT = 30000; - private static final Logger log = LoggerFactory.getLogger(Webhook.class); private String name; private String url; @@ -61,7 +59,7 @@ public class Webhook extends AbstractDescribableImpl { @Override public DescriptorImpl getDescriptor() { - return (DescriptorImpl) super.getDescriptor(); + return (DescriptorImpl) super.getDescriptor(); } @DataBoundConstructor @@ -215,8 +213,8 @@ public FormValidation doCheckUrl(@QueryParameter String value) { return FormUtils.formValidateUrl(value); } - public FormValidation doCheckGlobalUrl(@QueryParameter String value) { - if(StringUtils.isNotBlank(value)) { + public FormValidation doCheckGlobalUrl(@QueryParameter String value) { + if (StringUtils.isNotBlank(value)) { return FormUtils.formValidateUrl(value); } else { return FormValidation.ok(); diff --git a/src/main/java/jenkins/plugins/office365connector/model/adaptivecard/AdaptiveCard.java b/src/main/java/jenkins/plugins/office365connector/model/adaptivecard/AdaptiveCard.java index afa9994..34107e5 100644 --- a/src/main/java/jenkins/plugins/office365connector/model/adaptivecard/AdaptiveCard.java +++ b/src/main/java/jenkins/plugins/office365connector/model/adaptivecard/AdaptiveCard.java @@ -19,8 +19,7 @@ public class AdaptiveCard implements Card { private final String schema = "http://adaptivecards.io/schemas/adaptive-card.json"; @SuppressFBWarnings(value = "SS_SHOULD_BE_STATIC") private final String version = "1.4"; - @SerializedName("msTeams") - private final MsTeams msteams = new MsTeams(); + private final MsTeams msTeams = new MsTeams(); private final List body; private List actions; @@ -61,8 +60,8 @@ public String getVersion() { return version; } - public MsTeams getMsteams() { - return msteams; + public MsTeams getMsTeams() { + return msTeams; } public List getBody() { diff --git a/src/main/java/jenkins/plugins/office365connector/model/adaptivecard/MsTeams.java b/src/main/java/jenkins/plugins/office365connector/model/adaptivecard/MsTeams.java index ad23a90..38fd558 100644 --- a/src/main/java/jenkins/plugins/office365connector/model/adaptivecard/MsTeams.java +++ b/src/main/java/jenkins/plugins/office365connector/model/adaptivecard/MsTeams.java @@ -1,10 +1,7 @@ package jenkins.plugins.office365connector.model.adaptivecard; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - public class MsTeams { - @SuppressFBWarnings(value = "SS_SHOULD_BE_STATIC") private String width = "Full"; public String getWidth() { diff --git a/src/main/java/jenkins/plugins/office365connector/model/adaptivecard/Payload.java b/src/main/java/jenkins/plugins/office365connector/model/adaptivecard/Payload.java index 2295577..6bb076d 100644 --- a/src/main/java/jenkins/plugins/office365connector/model/adaptivecard/Payload.java +++ b/src/main/java/jenkins/plugins/office365connector/model/adaptivecard/Payload.java @@ -3,11 +3,8 @@ import java.util.ArrayList; import java.util.List; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - public class Payload { - @SuppressFBWarnings(value = "SS_SHOULD_BE_STATIC") private String type = "message"; private final List attachments = new ArrayList<>(); diff --git a/src/test/java/jenkins/plugins/office365connector/ActionablePotentialActionBuilderTest.java b/src/test/java/jenkins/plugins/office365connector/ActionableBuilderTest.java similarity index 99% rename from src/test/java/jenkins/plugins/office365connector/ActionablePotentialActionBuilderTest.java rename to src/test/java/jenkins/plugins/office365connector/ActionableBuilderTest.java index 5ae851e..aee6788 100644 --- a/src/test/java/jenkins/plugins/office365connector/ActionablePotentialActionBuilderTest.java +++ b/src/test/java/jenkins/plugins/office365connector/ActionableBuilderTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.mockito.MockedStatic; -public class ActionablePotentialActionBuilderTest { +public class ActionableBuilderTest { private static final String JOB_URL = "http://localhost/job/myFirstJob/167/display/redirect"; diff --git a/src/test/java/jenkins/plugins/office365connector/workflow/AdaptiveCardIT.java b/src/test/java/jenkins/plugins/office365connector/workflow/AdaptiveCardIT.java index 39d4967..ae56b15 100644 --- a/src/test/java/jenkins/plugins/office365connector/workflow/AdaptiveCardIT.java +++ b/src/test/java/jenkins/plugins/office365connector/workflow/AdaptiveCardIT.java @@ -92,7 +92,7 @@ public void testAdaptiveCardStarted() { notifier.sendBuildCompletedNotification(); // then - assertHasSameContent(workerData.get(0), FileUtils.getContentFile("adaptivecard_success.json")); + assertHasSameContent(workerData.get(0), FileUtils.getContentFile("adaptivecard-success.json")); assertEquals(1, workerConstruction.constructed().size()); } @@ -111,7 +111,7 @@ public void testAdaptiveCardStep() { notifier.sendBuildStepNotification(stepParameters); // then - assertHasSameContent(workerData.get(0), FileUtils.getContentFile("adaptivecard_step.json")); + assertHasSameContent(workerData.get(0), FileUtils.getContentFile("adaptivecard-step.json")); assertEquals(1, workerConstruction.constructed().size()); } } diff --git a/src/test/resources/requests/adaptivecard_step.json b/src/test/resources/requests/adaptivecard-step.json similarity index 100% rename from src/test/resources/requests/adaptivecard_step.json rename to src/test/resources/requests/adaptivecard-step.json diff --git a/src/test/resources/requests/adaptivecard_success.json b/src/test/resources/requests/adaptivecard-success.json similarity index 100% rename from src/test/resources/requests/adaptivecard_success.json rename to src/test/resources/requests/adaptivecard-success.json