Commit a3b56e5f authored by anthony's avatar anthony Committed by benjaminParisel

fix(export) Resources missing in

Bonita API resource was not exported in when the API
call is for a single resource (with id)
- fix regex and enhance testtest

Covers [BS-18222](
parent 3f9f9c54
......@@ -39,7 +39,7 @@ import org.bonitasoft.web.designer.visitor.ComponentVisitor;
public class PagePropertiesBuilder {
private static final String TEMPLATE_NAME = "";
private static final String BONITA_RESOURCE_REGEX = ".+/API/([^ /]*)/([^ /?]*)[^ /]*"; // matches ..... /API/{}/{}?...
private static final String BONITA_RESOURCE_REGEX = ".+/API/([^ /]*)/([^ /?]*)[/?]?[^ /]*"; // matches ..... /API/{}/{}?...
private TemplateEngine template;
private ComponentVisitor componentVisitor;
private AuthRulesCollector authRulesCollector;
......@@ -22,11 +22,7 @@ import static org.bonitasoft.web.designer.builder.ComponentBuilder.aComponent;
import static;
import static org.mockito.Mockito.when;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.*;
import org.bonitasoft.web.designer.builder.WidgetBuilder;
......@@ -102,11 +98,16 @@ public class PagePropertiesBuilderTest {
public void should_add_relative_bonita_resource_found_in_page_data() throws Exception {
page.setData(singletonMap("foo", anApiData("../API/bpm/userTask?filter=mine")));
Map<String, Data> dataMap = new TreeMap<String, Data>();
dataMap.put("foo", anApiData("../API/bpm/userTask?filter=mine"));
dataMap.put("bar", anApiData("../API/identity/user/1"));
dataMap.put("other", anApiData("../API/identity/group/1?param=value"));
String properties = new String(;
assertThat(properties).contains("resources=[GET|identity/user, GET|bpm/userTask, GET|identity/group]");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment