Skip to content

Commit

Permalink
fix: fixed property get naming to map
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias Brunkow Moser committed Jan 8, 2024
1 parent 5d67e28 commit 2ce9c46
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public Response create(@Valid @RequestBody DiscoverySearch searchBody) {
}
List<String> bpnList = new ArrayList<>();
for(BpnDiscovery bpnDiscovery : bpnDiscoveries){
bpnList.addAll(bpnDiscovery.getBpnNumbers());
bpnList.addAll(bpnDiscovery.mapBpnNumbers());
}
if(bpnList.size() == 0){
response.message = "The asset was not found in the BPN Discovery!";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ public class BpnDiscovery {
@JsonProperty("bpns")
List<BpnEndpoint> bpns;

@JsonProperty("bpnNumbers")
List<String> bpnNumbers;

/** CONSTRUCTOR(S) **/
@SuppressWarnings("Unused")
public BpnDiscovery(List<BpnEndpoint> bpns) {
Expand All @@ -68,7 +65,8 @@ public void setBpns(List<BpnEndpoint> bpns) {
}

/** METHODS **/
public List<String> getBpnNumbers(){

public List<String> mapBpnNumbers(){
return bpns.stream().map(
BpnEndpoint::getValue
).collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ void getBpnDiscovery() {
BpnDiscovery bpnDiscoveryEndpoint = (BpnDiscovery) jsonUtil.bindObject(bpnDiscoveryList.get(0), BpnDiscovery.class);

assertEquals(1, bpnDiscoveryList.size());
assertTrue(bpnDiscoveryEndpoint.getBpnNumbers().contains(bpn));
assertTrue(bpnDiscoveryEndpoint.mapBpnNumbers().contains(bpn));
assertEquals(bpnResourceId, bpnDiscoveryEndpoint.getBpns().get(0).getResourceId());

}
Expand Down

0 comments on commit 2ce9c46

Please sign in to comment.