Skip to content

Commit

Permalink
GH-142 remove MockXssApi
Browse files Browse the repository at this point in the history
  • Loading branch information
npeltier committed Sep 9, 2020
1 parent 08b7be9 commit 8469bad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 135 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
import static javax.servlet.http.HttpServletResponse.SC_OK;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import com.adobe.dx.admin.mocks.MockSlingXssApi;
import com.adobe.dx.mocks.MockCryptoSupport;
import com.adobe.dx.testing.AbstractTest;
import com.adobe.granite.crypto.CryptoSupport;
Expand Down Expand Up @@ -50,7 +52,10 @@ private void setup() {
"/apps/dx/services/private/encryptValues");
context.currentResource( "/apps/dx/services/private/encryptValues");
context.registerService(CryptoSupport.class, mockCryptoSupport);
context.registerService(XSSAPI.class, new MockSlingXssApi());
XSSAPI xssapi = mock(XSSAPI.class);
when(xssapi.encodeForJSString(anyString())).thenAnswer(i -> i.getArguments()[0]);
when(xssapi.filterHTML(anyString())).thenAnswer(i -> i.getArguments()[0]);
context.registerService(XSSAPI.class, xssapi);
request = context.request();
response = context.response();
context.registerInjectActivateService(encryptionServlet);
Expand Down

0 comments on commit 8469bad

Please sign in to comment.