@@ -0,0 +1,2120 @@
+package org.csanchez.aws.glacier.actions;%0A%0Aimport org.csanchez.aws.glacier.utils.MockTestHelper;%0Aimport org.jmock.Expectations;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport com.amazonaws.services.glacier.AmazonGlacierClient;%0Aimport com.amazonaws.services.glacier.model.ListVaultsRequest;%0Aimport com.amazonaws.services.glacier.model.ListVaultsResult;%0A%0Apublic class VaultsTest extends MockTestHelper %7B%0A%0A    private AmazonGlacierClient client;%0A%0A    @Before%0A    public void setUp() %7B%0A        client = mock( AmazonGlacierClient.class );%0A    %7D%0A%0A    @Test%0A    public void vaults_singleResultsList() %7B%0A        ListVaultsResult result = mock( ListVaultsResult.class );%0A%0A        expectThat( vaultServiceCallWith( result ) );%0A        expectThat( hasMoreResults( result, false ) );%0A%0A        new Vaults( client ).call();%0A    %7D%0A%0A    @Test%0A    public void vaults_multipleResultsList() %7B%0A        ListVaultsResult firstResult = mock( ListVaultsResult.class, %22Result with marker%22 );%0A        ListVaultsResult secondResult = mock( ListVaultsResult.class, %22Result with no marker%22 );%0A%0A        expectThat( vaultServiceCallWith( firstResult ) );%0A        expectThat( hasMoreResults( firstResult, true ) );%0A        expectThat( vaultServiceCallWith( secondResult ) );%0A        expectThat( hasMoreResults( secondResult, false ) );%0A%0A        new Vaults( client ).call();%0A    %7D%0A%0A    private Expectations vaultServiceCallWith( final ListVaultsResult result ) %7B%0A        return new Expectations() %7B%0A            %7B%0A                one( client ).listVaults( with( any( ListVaultsRequest.class ) ) );%0A                will( returnValue( result ) );%0A            %7D%0A        %7D;%0A    %7D%0A%0A    private Expectations hasMoreResults( final ListVaultsResult result, final boolean hasMoreResults ) %7B%0A        return new Expectations() %7B%0A            %7B%0A                allowing( result ).getVaultList();%0A%0A                one( result ).getMarker();%0A                if ( hasMoreResults ) %7B%0A                    will( returnValue( %22marker%22 ) );%0A                %7D else %7B%0A                    will( returnValue( null ) );%0A                %7D%0A            %7D%0A        %7D;%0A    %7D%0A%7D%0A

Add tests for Vaults callable to ensure that all vaults are acquired (multiple service calls are necessary if there are over 1000 vaults)