### Question:
AuthIdHelper { public SignedJwt reconstructAuthId(String authId) throws RestAuthException { try { return jwtBuilderFactory.reconstruct(authId, SignedJwt.class); } catch (JwtRuntimeException e) { throw new RestAuthException(ResourceException.BAD_REQUEST, "Failed to parse JWT, " + e.getLocalizedMessage(), e); } } @Inject  AuthIdHelper(CoreServicesWrapper coreServicesWrapper,
            JwtBuilderFactory jwtBuilderFactory, SigningManager signingManager); String createAuthId(LoginConfiguration loginConfiguration, AuthenticationContext authContext); SignedJwt reconstructAuthId(String authId); void verifyAuthId(String realmDN, String authId);  }### Answer:
@Test public void shouldReconstructAuthId() throws RestAuthException { authIdHelper.reconstructAuthId("AUTH_ID"); verify(jwtBuilderFactory).reconstruct("AUTH_ID", SignedJwt.class); }
@Test public void shouldThrowRestAuthExceptionWhenReconstructingAuthIdFails() { given(jwtBuilderFactory.reconstruct("AUTH_ID", SignedJwt.class)).willThrow(JwtRuntimeException.class); RestAuthException exception = null; boolean exceptionCaught = false; try { authIdHelper.reconstructAuthId("AUTH_ID"); fail(); } catch (RestAuthException e) { exception = e; exceptionCaught = true; } assertTrue(exceptionCaught); assertEquals(exception.getStatusCode(), 400); }