SSHKeyEditorServiceImpl implements SSHKeyEditorService { @Override public Collection<PortableSSHPublicKey> getUserKeys() { return keyStoreService.keyStore().getUserKeys(sessionInfo.getIdentity().getIdentifier()).stream() .map(this::convert) .collect(Collectors.toList()); } @Inject  SSHKeyEditorServiceImpl(SessionInfo sessionInfo, SSHKeyStoreService keyStoreService); @Override Collection<PortableSSHPublicKey> getUserKeys(); @Override void deleteKey(final PortableSSHPublicKey portableKey); @Override void addKey(String name, String keyContent);  }
@Test public void testKatyUser() { userName = KATY; Assertions.assertThat(service.getUserKeys()) .isNotNull() .hasSize(2); }
@Test public void testJohnUser() { userName = JOHN; Assertions.assertThat(service.getUserKeys()) .isNotNull() .hasSize(1); }