Remove pointless exception encapsulation
This commit is contained in:
parent
c793c138a3
commit
3009edf101
1 changed files with 14 additions and 28 deletions
|
@ -70,16 +70,11 @@ public class ScimClient<S extends ResourceNode> implements AutoCloseable {
|
|||
);
|
||||
}
|
||||
Retry retry = retryRegistry.retry("create-%s".formatted(id.asString()));
|
||||
ServerResponse<S> response = retry.executeSupplier(() -> {
|
||||
try {
|
||||
return scimRequestBuilder
|
||||
ServerResponse<S> response = retry.executeSupplier(() -> scimRequestBuilder
|
||||
.create(getResourceClass(), getScimEndpoint())
|
||||
.setResource(scimForCreation)
|
||||
.sendRequest();
|
||||
} catch (ResponseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
.sendRequest()
|
||||
);
|
||||
checkResponseIsSuccess(response);
|
||||
S resource = response.getResource();
|
||||
return resource.getId()
|
||||
|
@ -104,29 +99,20 @@ public class ScimClient<S extends ResourceNode> implements AutoCloseable {
|
|||
|
||||
public void replace(EntityOnRemoteScimId externalId, ResourceNode scimForReplace) {
|
||||
Retry retry = retryRegistry.retry("replace-%s".formatted(externalId.asString()));
|
||||
ServerResponse<S> response = retry.executeSupplier(() -> {
|
||||
try {
|
||||
return scimRequestBuilder
|
||||
ServerResponse<S> response = retry.executeSupplier(() -> scimRequestBuilder
|
||||
.update(getResourceClass(), getScimEndpoint(), externalId.asString())
|
||||
.setResource(scimForReplace)
|
||||
.sendRequest();
|
||||
} catch (ResponseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
.sendRequest()
|
||||
);
|
||||
checkResponseIsSuccess(response);
|
||||
}
|
||||
|
||||
public void delete(EntityOnRemoteScimId externalId) {
|
||||
Retry retry = retryRegistry.retry("delete-%s".formatted(externalId.asString()));
|
||||
ServerResponse<S> response = retry.executeSupplier(() -> {
|
||||
try {
|
||||
return scimRequestBuilder.delete(getResourceClass(), getScimEndpoint(), externalId.asString())
|
||||
.sendRequest();
|
||||
} catch (ResponseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
ServerResponse<S> response = retry.executeSupplier(() -> scimRequestBuilder
|
||||
.delete(getResourceClass(), getScimEndpoint(), externalId.asString())
|
||||
.sendRequest()
|
||||
);
|
||||
checkResponseIsSuccess(response);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue