Skip to content

Commit f7bd1a0

Browse files
committed
test(model-client): improve testing of the deleteRepository endpoint
1 parent 9361429 commit f7bd1a0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

model-server/src/main/kotlin/org/modelix/model/server/handlers/RepositoriesManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class RepositoriesManager(val client: LocalModelClient) {
8585
}
8686
}
8787

88-
fun repositoryExists(repositoryId: RepositoryId) = getRepositories().contains(repositoryId)
88+
private fun repositoryExists(repositoryId: RepositoryId) = getRepositories().contains(repositoryId)
8989

9090
fun createRepository(repositoryId: RepositoryId, userName: String?, useRoleIds: Boolean = true): CLVersion {
9191
var initialVersion: CLVersion? = null

model-server/src/test/kotlin/org/modelix/model/server/ModelClientV2Test.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,10 @@ class ModelClientV2Test {
164164
client.initRepository(repositoryId)
165165

166166
val success = client.deleteRepository(repositoryId)
167+
val containsRepository = client.listRepositories().contains(repositoryId)
167168

168169
assertEquals(true, success)
170+
assertEquals(false, containsRepository)
169171
}
170172

171173
@Test
@@ -175,7 +177,9 @@ class ModelClientV2Test {
175177
val repositoryId = RepositoryId(UUID.randomUUID().toString())
176178

177179
val success = client.deleteRepository(repositoryId)
180+
val containsRepository = client.listRepositories().contains(repositoryId)
178181

179182
assertEquals(false, success)
183+
assertEquals(false, containsRepository)
180184
}
181185
}

0 commit comments

Comments
 (0)