### Question:
Gateway3DSecureActivity extends AppCompatActivity { void setWebViewHtml(String html) { String encoded = Base64.encodeToString(html.getBytes(), Base64.NO_PADDING | Base64.NO_WRAP); webView.loadData(encoded, "text/html", "base64"); }   static final String EXTRA_HTML; static final String EXTRA_TITLE; static final String EXTRA_ACS_RESULT; }### Answer:
@Test public void testSetWebViewHtmlEncodesBase64() { String testHtml = "<html></html>"; String expectedEncodedHtml = "PGh0bWw+PC9odG1sPg"; activity.webView = mock(WebView.class); activity.setWebViewHtml(testHtml); verify(activity.webView).loadData(expectedEncodedHtml, "text/html", "base64"); }