Commit a4a53fc3 authored by Aurelien Pupier's avatar Aurelien Pupier
Browse files

Fix unit tests by adding mock

parent 7440e214
......@@ -40,6 +40,7 @@ public class TomcatVmArgsBuilderTest {
doNothing().when(tomcatVmArgsBuilder).addUIDesignerOptions(any(StringBuilder.class));
doNothing().when(tomcatVmArgsBuilder).addWatchDogProperties(any(StringBuilder.class));
doReturn("test.bonita.product.application.id").when(tomcatVmArgsBuilder).getProductApplicationId();
doReturn("bonita.home.root").when(tomcatVmArgsBuilder).getBonitaHomeRoot();
}
@Test
......
......@@ -47,7 +47,7 @@ public class TomcatVmArgsBuilder {
addSystemProperty(args, "btm.root", "\"" + tomcatInstanceLocation + "\"");
addSystemProperty(args, "wtp.deploy", "\"" + tomcatInstanceLocation + File.separatorChar + "webapps\"");
addSystemProperty(args, "java.endorsed.dirs", "\"" + tomcatInstanceLocation + File.separatorChar + "endorsed\"");
addSystemProperty(args, "bonita.home", "\"" + repositoryAccessor.getCurrentRepository().getBonitaHomeHandler().getRoot() + "\"");
addSystemProperty(args, "bonita.home", "\"" + getBonitaHomeRoot() + "\"");
addSystemProperty(args, "sysprop.bonita.db.vendor", "h2");
addSystemProperty(args, "bitronix.tm.configuration",
"\"" + tomcatInstanceLocation + File.separatorChar + "conf" + File.separatorChar + "bitronix-config.properties\"");
......@@ -69,6 +69,15 @@ public class TomcatVmArgsBuilder {
return res;
}
/**
* /!\ Public for test purpose only
*
* @return
*/
public String getBonitaHomeRoot() {
return repositoryAccessor.getCurrentRepository().getBonitaHomeHandler().getRoot();
}
public String getProductApplicationId() {
return Platform.getProduct() != null ? Platform.getProduct().getApplication() : null;
}
......
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