### Question:
RequestProviderServiceMock extends RequestProviderService { @Override public String getEncodedTppQwacCert() { return StringUtils.defaultIfBlank(super.getEncodedTppQwacCert(), qwacCertificateMock); } @Autowired  RequestProviderServiceMock(HttpServletRequest httpServletRequest,
                                      InternalRequestIdService internalRequestIdService); @Override String getEncodedTppQwacCert();  }### Answer:
@Test void getEncodedTppQwacCert_headerCertificate() { when(request.getHeader(RequestProviderService.TPP_QWAC_CERTIFICATE_HEADER)).thenReturn(QWAC_CERTIFICATE); String encodedTppQwacCert = requestProviderService.getEncodedTppQwacCert(); assertEquals(QWAC_CERTIFICATE, encodedTppQwacCert); }
@Test void getEncodedTppQwacCert_mockCertificate() { ReflectionTestUtils.setField(requestProviderService, "qwacCertificateMock", MOCK_QWAC_CERTIFICATE); when(request.getHeader(RequestProviderService.TPP_QWAC_CERTIFICATE_HEADER)).thenReturn(null); String encodedTppQwacCert = requestProviderService.getEncodedTppQwacCert(); assertEquals(MOCK_QWAC_CERTIFICATE, encodedTppQwacCert); }