CliState extends CliClassContainer { public Collection<CliArgumentContainer> getArguments() { return this.arguments; } CliState(Class<?> stateClass, PojoDescriptorBuilderFactory descriptorBuilderFactory, ReflectionUtil reflectionUtil, AnnotationUtil annotationUtil); CliOptionContainer getOption(String nameOrAlias); List<CliOptionContainer> getOptions(); Collection<CliArgumentContainer> getArguments(); List<CliArgumentContainer> getArguments(CliModeObject mode); Collection<CliOptionContainer> getOptions(CliModeObject mode);  }
@Test public void testArguments() { PojoDescriptorBuilderFactory descriptorBuilder = getPojoDescriptorBuilderFactory(); CliState state; state = createState(ArgumentTest1.class); List<CliArgumentContainer> argumentsList = state.getArguments(state.getMode(MODE_Z_EXTENDS_X_Y_HELP)); assertThat(argumentsList).hasSize(1); assertThat(argumentsList.get(0).getId()).isEqualTo(ARGUMENT_NAME_STRING); argumentsList = state.getArguments(state.getMode(CliMode.ID_HELP)); assertThat(argumentsList).hasSize(1); assertThat(argumentsList.get(0).getId()).isEqualTo(ARGUMENT_NAME_STRING); argumentsList = state.getArguments(state.getMode(CliMode.ID_DEFAULT)); assertThat(argumentsList).hasSize(4); assertThat(argumentsList.get(0).getId()).isEqualTo(ARGUMENT_NAME_BOOLEAN); assertThat(argumentsList.get(1).getId()).isEqualTo(ARGUMENT_NAME_FOO); assertThat(argumentsList.get(2).getId()).isEqualTo(ARGUMENT_NAME_BAR); assertThat(argumentsList.get(3).getId()).isEqualTo(ARGUMENT_NAME_STRING); state = createState(ArgumentTest2.class); argumentsList = state.getArguments(state.getMode(CliMode.ID_DEFAULT)); assertThat(argumentsList).hasSize(6); assertThat(argumentsList.get(0).getId()).isEqualTo(ARGUMENT_NAME_BOOLEAN); assertThat(argumentsList.get(1).getId()).isEqualTo(ARGUMENT_NAME_WHOOP); assertThat(argumentsList.get(2).getId()).isEqualTo(ARGUMENT_NAME_FOO); assertThat(argumentsList.get(3).getId()).isEqualTo(ARGUMENT_NAME_BAR); assertThat(argumentsList.get(4).getId()).isEqualTo(ARGUMENT_NAME_STRING); assertThat(argumentsList.get(5).getId()).isEqualTo(ARGUMENT_NAME_THING); }