GetContainerQuotaCommand extends SubutaiShellCommandSupport { @Override protected Object doExecute() throws Exception { Environment environment = environmentManager.loadEnvironment( environmentId ); ContainerHost targetContainer = environment.getContainerHostById( containerId ); if ( targetContainer == null ) { System.out.println( "Couldn't get container host by name: " + containerId ); } else { final ContainerQuota containerQuota = targetContainer.getQuota(); for ( Quota quota : containerQuota.getAll() ) { System.out.println( String.format( "%s\t%s", quota.getResource().getContainerResourceType(), quota.getResource().getPrintValue() ) ); } } return null; } GetContainerQuotaCommand( EnvironmentManager environmentManager );   }
@Test public void testDoExecute() throws Exception { command.doExecute(); when( environment.getContainerHostByHostname( anyString() ) ).thenReturn( null ); command.doExecute(); assertTrue( getSysOut().contains( CONTAINER_NAME ) ); }