@@ -0,0 +1,2809 @@
+package com.netflix.genie.agent.cli;%0A%0Aimport com.beust.jcommander.JCommander;%0Aimport com.google.common.collect.Sets;%0Aimport com.netflix.genie.test.categories.IntegrationTest;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.junit.experimental.categories.Category;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.test.context.SpringBootTest;%0Aimport org.springframework.context.ApplicationContext;%0Aimport org.springframework.test.context.junit4.SpringRunner;%0A%0Aimport java.lang.reflect.Field;%0Aimport java.lang.reflect.Modifier;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0Aimport java.util.stream.Collectors;%0A%0A/**%0A * Test CLI beans in context.%0A */%0A@Category(IntegrationTest.class)%0A@RunWith(SpringRunner.class)%0A@SpringBootTest%0Apublic class CommandsConfigIntegrationTest %7B%0A%0A    @Autowired%0A    private ApplicationContext applicationContext;%0A%0A    /**%0A     * Test creation of AgentArguments bean.%0A     * @throws Exception for error%0A     */%0A    @Test%0A    public void globalAgentArguments() throws Exception %7B%0A        Assert.assertNotNull(applicationContext.getBean(GlobalAgentArguments.class));%0A    %7D%0A%0A    /**%0A     * Test creation of JCommander bean.%0A     * @throws Exception for error%0A     */%0A    @Test%0A    public void jCommander() throws Exception %7B%0A        Assert.assertNotNull(applicationContext.getBean(JCommander.class));%0A    %7D%0A%0A    /**%0A     * Test creation of CommandFactory bean.%0A     * @throws Exception for error%0A     */%0A    @Test%0A    public void commandFactory() throws Exception %7B%0A        final CommandFactory factory = applicationContext.getBean(CommandFactory.class);%0A        Assert.assertNotNull(factory);%0A%0A        final List%3CString%3E commandNames = Arrays.stream(CommandNames.class.getDeclaredFields())%0A            .filter(f -%3E Modifier.isStatic(f.getModifiers()))%0A            .filter(f -%3E f.getType() == String.class)%0A            .map((Field f) -%3E %7B%0A                try %7B%0A                    return (String) f.get(null);%0A                %7D catch (IllegalAccessException e) %7B%0A                    throw new RuntimeException(%22Failed to get value for field %22 + f.getName());%0A                %7D%0A            %7D)%0A            .collect(Collectors.toList());%0A%0A        Assert.assertEquals(%0A            Sets.newHashSet(commandNames),%0A            Sets.newHashSet(factory.getCommandNames())%0A        );%0A%0A        for (String commandName : commandNames) %7B%0A            final AgentCommand command = factory.get(commandName);%0A            Assert.assertNotNull(command);%0A        %7D%0A    %7D%0A%0A    /**%0A     * Test creation of ArgumentParser bean.%0A     * @throws Exception for error%0A     */%0A    @Test%0A    public void argumentParser() throws Exception %7B%0A        Assert.assertNotNull(applicationContext.getBean(ArgumentParser.class));%0A    %7D%0A%7D%0A

Add integration test for CLI beans