LocalEnvironment implements Environment, Serializable { @Override public void removeSshKey( final String sshKey, final boolean async ) throws EnvironmentModificationException { try { environmentManager.removeSshKey( getId(), sshKey, async ); } catch ( EnvironmentNotFoundException e ) { LOG.error( String.format( "Error removing ssh key from environment %s", getName() ), e ); throw new EnvironmentModificationException( e ); } } protected  LocalEnvironment();  LocalEnvironment( String name, String sshKey, Long userId, String peerId ); boolean isUploaded(); void markAsUploaded(); void markAsNotUploaded(); boolean isDeleted(); void markAsDeleted(); @Override void addSshKey( final String sshKey, final boolean async ); @Override void removeSshKey( final String sshKey, final boolean async ); @Override Set<String> getSshKeys(); void addSshKey( final String sshKey ); void removeSshKey( final String sshKey ); @Override long getCreationTimestamp(); @Override String getName(); SshEncryptionType getSshKeyType(); void setSshKeyType( final SshEncryptionType sshKeyType ); @Override Long getUserId(); void setUserId( final Long userId ); @Override EnvironmentStatus getStatus(); void setStatus( EnvironmentStatus status ); String getStatusDescription(); void setStatusDescription( final String statusDescription ); void setRawTopology( final String rawBlueprint ); @Override String getPeerId(); @Override EnvironmentContainerHost getContainerHostById( String id ); @Override EnvironmentContainerHost getContainerHostByIp( String ip ); @Override Set<EnvironmentContainerHost> getContainerHostsByPeerId( String id ); @Override EnvironmentContainerHost getContainerHostByHostname( String hostname ); @Override Set<EnvironmentContainerHost> getContainerHostsByIds( Set<String> ids ); void addEnvironmentPeer( final EnvironmentPeerImpl environmentPeer ); void removeEnvironmentPeer( final String peerId ); void excludePeerFromEnvironment( String peerId ); EnvironmentPeerImpl getEnvironmentPeer( String peerId ); @Override Set<EnvironmentPeer> getEnvironmentPeers(); @Override String getId(); @Override Set<ContainerDto> getContainerDtos(); @Override Set<EnvironmentContainerHost> getContainerHosts(); void addContainers( Set<EnvironmentContainerImpl> containers ); synchronized void removeContainer( EnvironmentContainerHost container ); @Override void destroyContainer( EnvironmentContainerHost containerHost, boolean async ); @Override Set<Peer> getPeers(); void setEnvironmentManager( final EnvironmentManagerImpl environmentManager ); @Override boolean equals( final Object o ); @Override int hashCode(); @Override String getSubnetCidr(); @Override void setSubnetCidr( final String cidr ); @Override Long getVni(); void setVni( long vni ); @Override String getP2pSubnet(); void setP2PSubnet( final String p2pSubnet ); @Override P2pIps getP2pIps(); @Override boolean isMember( final Peer peer ); @Override String getP2PHash(); String getP2pKey(); void setP2pKey( final String p2pKey ); @Override EnvironmentId getEnvironmentId(); @Override Set<EnvironmentAlertHandler> getAlertHandlers(); void addAlertHandler( EnvironmentAlertHandler environmentAlertHandler ); void removeAlertHandler( EnvironmentAlertHandler environmentAlertHandler ); @Override String toString(); @Override String getLinkId(); @Override String getUniqueIdentifier(); @Override String getClassPath(); @Override String getContext(); @Override String getKeyId();  }
@Test public void testRemoveSshKey() throws Exception { environment.removeSshKey( SSH_KEY, true ); verify( environmentManager ).removeSshKey( environment.getId(), SSH_KEY, true ); }