Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EyalDelarea committed Nov 11, 2024
1 parent 5ca2daf commit e4e8e09
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class AccessManagerTest extends IntegrationTestsBase {
@BeforeClass
@Override
public void init() throws IOException {
super.init();
super.init(true);
String accessUrl = getPlatformUrl() + "access";
accessManager = new AccessManager(accessUrl, getAdminToken(), getLog());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ public static Log getLog() {
return log;
}

@BeforeClass
public void init() throws IOException {
public void init(boolean isAccessTest) throws IOException {
Properties props = new Properties();
// This file is not in GitHub. Create your own in src/test/resources or use environment variables.
InputStream inputStream = this.getClass().getResourceAsStream("/artifactory-bi.properties");
Expand All @@ -69,8 +68,13 @@ public void init() throws IOException {
props.load(inputStream);
inputStream.close();
}
String testPort = "8081";
// Change the port variable only if isAccessTest is true
if (isAccessTest) {
testPort = "8082";
}

platformUrl = readParam(props, "url", "http://127.0.0.1:8082");
platformUrl = readParam(props, "url", "http://127.0.0.1:" + testPort);
if (!platformUrl.endsWith("/")) {
platformUrl += "/";
}
Expand All @@ -92,6 +96,16 @@ public void init() throws IOException {
}
}

@BeforeClass
public void init() throws IOException {
init(false);
}

@BeforeClass
public void accessInit() throws IOException {
init(true);
}

@AfterClass
protected void terminate() throws IOException {
// Delete the virtual first.
Expand Down

0 comments on commit e4e8e09

Please sign in to comment.