@Test public void testGrpSignature() { Utkast utkast = createUtkast(INTYG_ID, 1L, INTYG_TYP, UtkastStatus.DRAFT_COMPLETE, "model", vardperson, ENHET_ID, PERSON_ID); when(utkastRepository.findById(INTYG_ID)).thenReturn(Optional.of(utkast)); SignaturBiljett signaturBiljett = createSignaturBiljett(SignaturStatus.BEARBETAR); when(redisTicketTracker.findBiljett(TICKET_ID)).thenReturn(signaturBiljett); when(grpUnderskriftService.finalizeSignature(any(SignaturBiljett.class), any(byte[].class), ArgumentMatchers.isNull(), any(Utkast.class), any(WebCertUser.class))) .thenReturn(createSignaturBiljett(SIGNERAD)); SignaturBiljett sb = testee.grpSignature(TICKET_ID, "signatur".getBytes(StandardCharsets.UTF_8)); assertNotNull(sb); assertEquals(SIGNERAD, sb.getStatus()); verify(certificateEventService) .createCertificateEvent(anyString(), anyString(), eq(EventCode.SIGNAT), anyString()); }
@Override public SignaturBiljett grpSignature(String biljettId, byte[] signatur) { SignaturBiljett sb = redisTicketTracker.findBiljett(biljettId); WebCertUser user = webCertUserService.getUser(); Utkast utkast = getUtkastForSignering(sb.getIntygsId(), sb.getVersion(), user); sb = grpUnderskriftService.finalizeSignature(sb, signatur, null, utkast, user); finalizeSignature(utkast, user); return sb; }
UnderskriftServiceImpl implements UnderskriftService { @Override public SignaturBiljett grpSignature(String biljettId, byte[] signatur) { SignaturBiljett sb = redisTicketTracker.findBiljett(biljettId); WebCertUser user = webCertUserService.getUser(); Utkast utkast = getUtkastForSignering(sb.getIntygsId(), sb.getVersion(), user); sb = grpUnderskriftService.finalizeSignature(sb, signatur, null, utkast, user); finalizeSignature(utkast, user); return sb; } }
UnderskriftServiceImpl implements UnderskriftService { @Override public SignaturBiljett grpSignature(String biljettId, byte[] signatur) { SignaturBiljett sb = redisTicketTracker.findBiljett(biljettId); WebCertUser user = webCertUserService.getUser(); Utkast utkast = getUtkastForSignering(sb.getIntygsId(), sb.getVersion(), user); sb = grpUnderskriftService.finalizeSignature(sb, signatur, null, utkast, user); finalizeSignature(utkast, user); return sb; }  }
UnderskriftServiceImpl implements UnderskriftService { @Override public SignaturBiljett grpSignature(String biljettId, byte[] signatur) { SignaturBiljett sb = redisTicketTracker.findBiljett(biljettId); WebCertUser user = webCertUserService.getUser(); Utkast utkast = getUtkastForSignering(sb.getIntygsId(), sb.getVersion(), user); sb = grpUnderskriftService.finalizeSignature(sb, signatur, null, utkast, user); finalizeSignature(utkast, user); return sb; }  @Override SignaturBiljett startSigningProcess(String intygsId, String intygsTyp, long version, SignMethod signMethod,
        String ticketId); @Override SignaturBiljett fakeSignature(String intygsId, String intygsTyp, long version, String ticketId); @Override SignaturBiljett netidSignature(String biljettId, byte[] signatur, String certifikat); @Override SignaturBiljett grpSignature(String biljettId, byte[] signatur); @Override SignaturBiljett signeringsStatus(String ticketId); }
UnderskriftServiceImpl implements UnderskriftService { @Override public SignaturBiljett grpSignature(String biljettId, byte[] signatur) { SignaturBiljett sb = redisTicketTracker.findBiljett(biljettId); WebCertUser user = webCertUserService.getUser(); Utkast utkast = getUtkastForSignering(sb.getIntygsId(), sb.getVersion(), user); sb = grpUnderskriftService.finalizeSignature(sb, signatur, null, utkast, user); finalizeSignature(utkast, user); return sb; }  @Override SignaturBiljett startSigningProcess(String intygsId, String intygsTyp, long version, SignMethod signMethod,
        String ticketId); @Override SignaturBiljett fakeSignature(String intygsId, String intygsTyp, long version, String ticketId); @Override SignaturBiljett netidSignature(String biljettId, byte[] signatur, String certifikat); @Override SignaturBiljett grpSignature(String biljettId, byte[] signatur); @Override SignaturBiljett signeringsStatus(String ticketId);  }