SignatureKeyManager { @VisibleForTesting @PostConstruct void subscribe() { eventService.subscribe(workspaceEventsSubscriber); } @Inject  SignatureKeyManager(
      @Named("che.auth.signature_key_size") int keySize,
      @Named("che.auth.signature_key_algorithm") String algorithm,
      EventService eventService,
      SignatureKeyDao signatureKeyDao); KeyPair getOrCreateKeyPair(String workspaceId); static final String PKCS_8; static final String X_509; }
@Test public void shouldRemoveKeyPairOnWorkspaceStop() throws Exception { final String wsId = "ws123"; signatureKeyManager.subscribe(); verify(eventService).subscribe(captor.capture()); final EventSubscriber<WorkspaceStatusEvent> subscriber = captor.getValue(); subscriber.onEvent( DtoFactory.newDto(WorkspaceStatusEvent.class) .withStatus(WorkspaceStatus.STOPPED) .withWorkspaceId(wsId)); verify(signatureKeyDao, times(1)).remove(eq(wsId)); }