Skip to content

Commit

Permalink
fix: replace AssertJ's deprecated asList() DSL method in RegistryConf…
Browse files Browse the repository at this point in the history
…igTest (3244)

refactor: improve assertion statements for registry config settings extraction

Signed-off-by: Raushan <[email protected]>
---
fix: corrected class type

Signed-off-by: Raushan <[email protected]>
  • Loading branch information
raushan606 authored Jul 23, 2024
1 parent 7d3b969 commit 15542db
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
import org.assertj.core.api.InstanceOfAssertFactories;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -42,7 +43,9 @@ void rawDeserialization() throws IOException {
.hasFieldOrPropertyWithValue("registry", "the-registry")
.hasFieldOrPropertyWithValue("skipExtendedAuth", true)
.hasFieldOrPropertyWithValue("authConfig", null)
.extracting(RegistryConfig::getSettings).asList().hasSize(1).extracting("id", "username")
.extracting(RegistryConfig::getSettings).asInstanceOf(InstanceOfAssertFactories.list(RegistryServerConfiguration.class))
.hasSize(1)
.extracting("id", "username")
.containsExactly(tuple("server-1", "the-user"));
}
}

0 comments on commit 15542db

Please sign in to comment.