@@ -0,0 +1,2078 @@
+package com.github.sbugat.ec2tools.service;%0A%0Aimport java.util.ArrayList;%0A%0Aimport org.assertj.core.api.Assertions;%0Aimport org.assertj.core.util.Lists;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.mockito.Mockito;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0Aimport com.github.sbugat.GenericMockitoTest;%0Aimport com.github.sbugat.ec2tools.service.aws.AmazonEC2Service;%0Aimport com.github.sbugat.ec2tools.service.configuration.ConfigurationService;%0Aimport com.github.sbugat.ec2tools.service.options.ProgramOptions;%0A%0A/**%0A * Start stop core service test.%0A * %0A * @author Sylvain Bugat%0A */%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class StartStopServiceTest extends GenericMockitoTest %7B%0A%0A%09private static final String SECTION_1 = %22Section 1%22;%0A%09private static final String SECTION_2 = %22Section 2%22;%0A%0A%09@Mock%0A%09private AmazonEC2Service amazonEC2Service;%0A%0A%09@Mock%0A%09private ConfigurationService configurationService;%0A%0A%09@InjectMocks%0A%09private StartStopService startStopService;%0A%0A%09@Test%0A%09public void testProcessAllSectionsEmpty() %7B%0A%0A%09%09final ProgramOptions programOptions = new ProgramOptions(true, false, false, false, new ArrayList%3CString%3E());%0A%0A%09%09Assertions.assertThat(startStopService.processAllSections(programOptions)).isFalse();%0A%09%7D%0A%0A%09@Test%0A%09public void testProcessAllSectionsUnknownSection() %7B%0A%0A%09%09final ProgramOptions programOptions = new ProgramOptions(true, false, false, false, Lists.newArrayList(SECTION_1));%0A%09%09Mockito.doReturn(null).when(configurationService).getConfiguredSections(SECTION_1);%0A%0A%09%09Assertions.assertThat(startStopService.processAllSections(programOptions)).isTrue();%0A%0A%09%09Mockito.verify(configurationService).getConfiguredSections(SECTION_1);%0A%09%7D%0A%0A%09@Test%0A%09public void testProcessAllSectionsEmptySection() %7B%0A%0A%09%09final ProgramOptions programOptions = new ProgramOptions(true, false, false, false, Lists.newArrayList(SECTION_1));%0A%0A%09%09Assertions.assertThat(startStopService.processAllSections(programOptions)).isFalse();%0A%0A%09%09Mockito.verify(configurationService).getConfiguredSections(SECTION_1);%0A%09%7D%0A%7D%0A

Add StartStopServiceTest