Skip to content

Conversation

@yevgenys
Copy link

refactored SMSCShellExecutor:removed duplicates for CLI get command;
added new option to CLI get command;
added tests for CLI get command;
added new flag 'markTimeoutAsPermanentFailure' to SmscPropertiesManagement;
added functionality for new flag;
Fixes #289

reduced code in ShellExecutor;
added discovery of new getters via reflection:
no need to add manual call of getter method, getter will be discovered automatically

    private void initSmscPropertiesManagementGetters() {
        smscPropertiesManagementGetters = new HashMap<>();
        Class c = smscPropertiesManagement.getClass();
        for (Method method : c.getMethods()) {
            String methodName = method.getName();
            if (methodName.startsWith("get")) {
                smscPropertiesManagementGetters.put(methodName.substring(3).toLowerCase(), method);
            } else if (methodName.startsWith("is")) {
                smscPropertiesManagementGetters.put(methodName.substring(2).toLowerCase(), method);
            }
        }
    }

then just call function
addProperty(sb, "${getterNameWithout_get|is}");

…mmand;

added new option to CLI get command;
added tests for CLI get command;
added new flag 'markTimeoutAsPermanentFailure' to SmscPropertiesManagement;
added functionality for new flag;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant