BonitaResourceTransformer implements Function<Variable, String> { @Override public String apply(Variable variable) { String variableValue = (variable.getValue() != null && !variable.getValue().isEmpty()) ? variable.getValue().get(0) : ""; return resourceURLFunction.apply(variableValue); } BonitaResourceTransformer(String bonitaResourceRegex); @Override String apply(Variable variable);  }
@Test public void should_transform_mathing_two_groups_into_an_authorisation_resource_token() throws Exception { String url = transformer.apply(aConstantVariable() .value("group1/group2") .build()); assertThat(url).isEqualTo("GET|group1/group2"); }
@Test public void should_return_an_empty_string_the_url_value_do_not_matches() throws Exception { String url = transformer.apply(aConstantVariable() .value("/path/to/whatever/resource") .build()); assertThat(url).isEqualTo(""); }