From 041320c3780cde647e0279b3a764da460fb1a44d Mon Sep 17 00:00:00 2001 From: Przemek Bednarek Date: Fri, 29 Jun 2018 17:42:23 +0200 Subject: [PATCH] json output minor fixes --- src/main/java/com/cognifide/secureaem/cli/Main.java | 8 ++++---- src/main/java/com/cognifide/secureaem/json/Severity.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/cognifide/secureaem/cli/Main.java b/src/main/java/com/cognifide/secureaem/cli/Main.java index c63b5ab..0060ff8 100644 --- a/src/main/java/com/cognifide/secureaem/cli/Main.java +++ b/src/main/java/com/cognifide/secureaem/cli/Main.java @@ -59,14 +59,14 @@ private static List createTestLoaders(CommandLine cmdLine) List testLoaders = new ArrayList<>(); String line; while ((line = reader.readLine()) != null) { - String[] parameters = line.split(", "); + String[] parameters = line.split(","); if (parameters.length >= 2) { - Class clazz = Class.forName(parameters[0]); + Class clazz = Class.forName(parameters[0].trim()); Severity severity = Severity.MAJOR; if (parameters.length == 3) { - severity = Severity.of(parameters[2]); + severity = Severity.of(parameters[2].trim()); } - testLoaders.add(new TestLoader(clazz, parameters[1], severity)); + testLoaders.add(new TestLoader(clazz, parameters[1].trim(), severity)); } } return testLoaders; diff --git a/src/main/java/com/cognifide/secureaem/json/Severity.java b/src/main/java/com/cognifide/secureaem/json/Severity.java index 0615dc1..1e60cbb 100644 --- a/src/main/java/com/cognifide/secureaem/json/Severity.java +++ b/src/main/java/com/cognifide/secureaem/json/Severity.java @@ -16,6 +16,6 @@ private Severity(String value) { public static Severity of(String value) { return Arrays.stream(Severity.values()) .filter(severity -> StringUtils.equals(severity.value, value)) - .findFirst().orElse(null); + .findFirst().orElse(INFO); } }