Skip to content

Commit

Permalink
feat(irs):[#249] fixed sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-psosnowski committed Jan 31, 2024
1 parent 002b5d0 commit 8b9bbad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected JsonObjectToPolicyTransformer(final ObjectMapper objectMapper) {
final Policy.PolicyBuilder builder = Policy.builder();
builder.policyId(getId(jsonObject));

this.visitProperties(jsonObject, (key) -> v -> {
this.visitProperties(jsonObject, key -> v -> {
try {
final Object result = objectMapper.readerFor(Policy.class).readValue(v.asJsonObject().toString());
builder.permissions(((Policy) result).getPermissions());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void setUp() {
}

@Test
public void shouldTransformJsonObjectToPolicyCorrectly() {
void shouldTransformJsonObjectToPolicyCorrectly() {
// given
JsonReader jsonReader = Json.createReader(new StringReader(EXAMPLE_PAYLOAD));
JsonObject jsonObject = jsonReader.readObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
public record CreatePolicyRequest(
@NotNull @Schema(description = "Timestamp after which the policy will no longer be accepted in negotiations") OffsetDateTime validUntil,
@NotNull @Schema(example = CreatePolicyRequest.EXAMPLE_PAYLOAD) JsonObject payload) {
@SuppressWarnings("java:S2479") // this value is used by open-api to show example payload, \u0009 character is required for this value to be correctly shown in open-api
public static final String EXAMPLE_PAYLOAD = """
{
"validUntil": "2025-12-12T23:59:59.999Z",
Expand Down

0 comments on commit 8b9bbad

Please sign in to comment.