Skip to content

Commit

Permalink
Passing force param to deleteNamespaceBundle when delete namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
coderzc committed Oct 21, 2022
1 parent fa328a4 commit 20f2bb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ protected CompletableFuture<Void> internalDeleteNamespaceAsync(boolean force) {
return FutureUtil.failedFuture(ex);
}
return admin.namespaces().deleteNamespaceBundleAsync(namespaceName.toString(),
bundle.getBundleRange());
bundle.getBundleRange(), force);
}
return CompletableFuture.completedFuture(null);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ public boolean matches(NamespaceBundle bundle) {
preconditionFailed.completeExceptionally(new PulsarAdminException.PreconditionFailedException(cee,
httpError, statusCode));
doReturn(preconditionFailed).when(namespacesAdmin)
.deleteNamespaceBundleAsync(Mockito.anyString(), Mockito.anyString());
.deleteNamespaceBundleAsync(Mockito.anyString(), Mockito.anyString(), Mockito.anyBoolean());

AsyncResponse response = mock(AsyncResponse.class);
ArgumentCaptor<RestException> captor = ArgumentCaptor.forClass(RestException.class);
Expand All @@ -866,7 +866,8 @@ public boolean matches(NamespaceBundle bundle) {
doReturn(Optional.of(localWebServiceUrl)).when(nsSvc).getWebServiceUrl(nsBundles.getBundles().get(0), optionsHttps);
doReturn(true).when(nsSvc).isServiceUnitOwned(nsBundles.getBundles().get(0));
doReturn(CompletableFuture.completedFuture(null)).when(namespacesAdmin).deleteNamespaceBundleAsync(
testTenant + "/" + testLocalCluster + "/" + bundledNsLocal, "0x00000000_0x80000000");
testTenant + "/" + testLocalCluster + "/" + bundledNsLocal, "0x00000000_0x80000000",
false);
response = mock(AsyncResponse.class);
namespaces.deleteNamespaceBundle(response, testTenant, testLocalCluster, bundledNsLocal,
"0x80000000_0xffffffff", false, false);
Expand Down

0 comments on commit 20f2bb6

Please sign in to comment.