@Override
  public Code issueCode(Session session, IdTokenJWS idTokenJWS) {
    var code = IdGenerator.generateID();
    var value =
        new Code(
            code,
            clock.instant(),
            clock.instant().plus(TTL),
            session.redirectUri(),
            session.nonce(),
            session.clientId(),
            idTokenJWS);
    codeRepo.save(value);
    return value;
  }
@Test
  void issueCode_notExpired() {
    var issuer = URI.create("https://idp.example.com");
    var keyStore = mock(KeyStore.class);
    var codeRepo = mock(CodeRepo.class);

    var sut = new TokenIssuerImpl(issuer, keyStore, codeRepo);

    var session = Session.create().build();

    // when
    var c1 = sut.issueCode(session, null);

    // then
    var now = Instant.now();
    assertTrue(c1.issuedAt().isBefore(now));
    assertTrue(c1.expiresAt().isAfter(now));
  }