Skip to content

Commit

Permalink
fix tenant names in test case
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Harzenetter <lharzenetter@gmx.de>
  • Loading branch information
lharzenetter committed Aug 16, 2021
1 parent 6a19e4b commit c99ce7b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
Expand Up @@ -28,7 +28,7 @@ public void testTenantRepository() throws Exception {

String[] results = new String[3];

Thread tenant1Thread = new Thread(() -> {
Thread tenant1Thread = new Thread(() ->
results[0] = start()
.accept(ContentType.JSON.toString())
.get(callURL("servicetemplates/?xTenant=tenant_1"))
Expand All @@ -39,13 +39,13 @@ public void testTenantRepository() throws Exception {
.extract()
.response()
.getBody()
.asString();
});
.asString()
);

Thread tenant2Thread = new Thread(() -> {
Thread tenant2Thread = new Thread(() ->
results[1] = start()
.accept(ContentType.JSON.toString())
.header(new Header("xTenant", "tenant2"))
.header(new Header("xTenant", "tenant_2"))
.get(callURL("servicetemplates/"))
.then()
.log()
Expand All @@ -54,13 +54,13 @@ public void testTenantRepository() throws Exception {
.extract()
.response()
.getBody()
.asString();
});
.asString()
);

Thread tenant3Thread = new Thread(() -> {
Thread tenant3Thread = new Thread(() ->
results[2] = start()
.accept(ContentType.JSON.toString())
.header(new Header("xTenant", "tenant3"))
.header(new Header("xTenant", "tenant_3"))
.get(callURL("servicetemplates/"))
.then()
.log()
Expand All @@ -69,8 +69,8 @@ public void testTenantRepository() throws Exception {
.extract()
.response()
.getBody()
.asString();
});
.asString()
);

tenant1Thread.start();
tenant2Thread.start();
Expand Down
Expand Up @@ -9,6 +9,6 @@
"id": "test53",
"name": "test53",
"namespace": "namespace",
"qName": "{namespace}test3"
"qName": "{namespace}test53"
}
]
Expand Up @@ -14,6 +14,7 @@

package org.eclipse.winery.repository.filebased;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
Expand Down Expand Up @@ -69,6 +70,15 @@ public TenantRepository(Path repositoryRoot) throws IOException, GitAPIException
this.defaultRepository = this.createRepo(
new GitBasedRepositoryConfiguration(false, fileBasedConfig)
);

File[] files = this.repositoryRoot.toFile().listFiles(File::isDirectory);
if (files != null) {
for (File file : files) {
if (!".git".equals(file.getName()) || !defaultRepositoryFolder.equals(file.getName())) {
initTenantRepository(file.getName());
}
}
}
}

public TenantRepository(Path repositoryRoot, List<String> tenants) throws IOException, GitAPIException {
Expand Down

0 comments on commit c99ce7b

Please sign in to comment.