@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_unique() {
    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);
    var c2 = sut.issueCode(session, null);

    // then
    assertNotNull(c1);
    assertNotNull(c2);

    assertNotEquals(c1.code(), c2.code());

    assertEquals(43, c1.code().length());
  }