Skip to content

Commit

Permalink
Remove hard Burp jar dependency for test class
Browse files Browse the repository at this point in the history
  • Loading branch information
CoreyD97 committed Jan 24, 2023
1 parent bf5c2aa commit cf30670
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
implementation 'org.apache.commons:commons-text:1.10.0'
implementation 'org.apache.logging.log4j:log4j-core:2.19.0'

testCompileOnly files("${System.properties['user.home']}/BurpSuitePro/burpsuite_pro.jar")
testRuntimeOnly files("${System.properties['user.home']}/BurpSuitePro/burpsuite_pro.jar")
}

jar {
Expand Down
9 changes: 8 additions & 1 deletion src/test/java/Test.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import java.lang.reflect.Method;

public class Test {
public static void main(String[] args) {
burp.StartBurp.main(args);
try {
Method main = Class.forName("burp.StartBurp").getMethod("main", String[].class);
main.invoke(null, (Object) args);
}catch (Exception e){
System.err.println("Cannot start burp. Check the burp jar is correctly included in the classpath.");
}
}
}

0 comments on commit cf30670

Please sign in to comment.