use of org.kie.workbench.common.stunner.bpmn.client.forms.util.StringUtils in project kie-wb-common by kiegroup.
the class AssignmentBaseTest method setUp.
public void setUp() throws Exception {
// Prevent runtime GWT.create() error at DesignerEditorConstants.INSTANCE
GWTMockUtilities.disarm();
// MockDesignerEditorConstants replaces DesignerEditorConstants.INSTANCE
final Answer answer = invocation -> invocation.getMethod().getName();
final StunnerFormsClientFieldsConstants constants = mock(StunnerFormsClientFieldsConstants.class, answer);
setFinalStaticField(StunnerFormsClientFieldsConstants.class.getDeclaredField("CONSTANTS"), constants);
// Prevent GWT calls in StringUtils
URL url = mock(URL.class);
when(url.decodeQueryString(any())).thenAnswer(invocation -> {
Object[] args = invocation.getArguments();
return urlDecode((String) args[0]);
});
when(url.encodeQueryString(any())).thenAnswer(invocation -> {
Object[] args = invocation.getArguments();
return urlEncode((String) args[0]);
});
StringUtils.setURL(url);
}
Aggregations