Skip to content

Commit

Permalink
Replace deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
bmalinowsky committed Nov 1, 2023
1 parent d386a46 commit 8142e3d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/io/calimero/baos/ip/BaosIp.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Calimero 2 - A library for KNX network access
Copyright (c) 2019, 2021 B. Malinowsky
Copyright (c) 2019, 2023 B. Malinowsky
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -49,7 +49,7 @@ public final class BaosIp {


public static boolean supportsBaos(final Discoverer.Result<SearchResponse> result) {
final var mfrDib = result.getResponse().description().stream().filter(ManufacturerDIB.class::isInstance)
final var mfrDib = result.response().description().stream().filter(ManufacturerDIB.class::isInstance)
.map(ManufacturerDIB.class::cast).filter(dib -> dib.getStructLength() == 8).findFirst();
if (mfrDib.isEmpty())
return false;
Expand Down
4 changes: 2 additions & 2 deletions test/io/calimero/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public static IndividualAddress getRouterAddress()
d.startSearch(2, true);
if (d.getSearchResponses().isEmpty())
return null;
device = d.getSearchResponses().get(0).getResponse().getDevice().getAddress();
device = d.getSearchResponses().get(0).response().getDevice().getAddress();
}
catch (final InterruptedException e) {
e.printStackTrace();
Expand Down Expand Up @@ -255,7 +255,7 @@ public static synchronized InetSocketAddress getServer()
e.printStackTrace();
}
for (final Result<SearchResponse> r : d.getSearchResponses()) {
final SearchResponse res = r.getResponse();
final SearchResponse res = r.response();
if (testServerId.equals(res.getDevice().getName())) {
final InetAddress addr = res.getControlEndpoint().getAddress();
server = new InetSocketAddress(addr, res.getControlEndpoint().getPort());
Expand Down
2 changes: 1 addition & 1 deletion test/io/calimero/baos/BaosTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class BaosTest {
static void init() throws InterruptedException, ExecutionException {
final var discoverer = new Discoverer(0, true);
list = new ArrayList<>(discoverer.timeout(Duration.ofSeconds(2)).search().get());
list.removeIf(r -> !r.getResponse().getDevice().getName()
list.removeIf(r -> !r.response().getDevice().getName()
.contains("calimero-core knx test-server"));
if (list.isEmpty())
fail("no KNX IP server found");
Expand Down
10 changes: 5 additions & 5 deletions test/io/calimero/knxnetip/DiscovererTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@

package io.calimero.knxnetip;

import static io.calimero.knxnetip.util.Srp.withService;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static io.calimero.knxnetip.util.Srp.withService;

import java.net.InetSocketAddress;
import java.net.SocketException;
Expand All @@ -65,8 +65,6 @@
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.opentest4j.AssertionFailedError;

import tag.KnxnetIP;
import tag.Slow;
import io.calimero.KNXException;
import io.calimero.KNXIllegalArgumentException;
import io.calimero.Util;
Expand All @@ -75,6 +73,8 @@
import io.calimero.knxnetip.servicetype.DescriptionResponse;
import io.calimero.knxnetip.servicetype.SearchResponse;
import io.calimero.knxnetip.util.ServiceFamiliesDIB.ServiceFamily;
import tag.KnxnetIP;
import tag.Slow;


@KnxnetIP
Expand Down Expand Up @@ -191,7 +191,7 @@ private void doGetSearchRes(final Discoverer d) throws InterruptedException
final List<Result<SearchResponse>> search = d.getSearchResponses();
assertFalse(search.isEmpty());
for (final Result<SearchResponse> result : search) {
final SearchResponse response = result.getResponse();
final SearchResponse response = result.response();
assertNotNull(response);
assertNotNull(result.localEndpoint().getAddress());
assertNotEquals(0, result.localEndpoint().getPort());
Expand Down Expand Up @@ -237,7 +237,7 @@ private void doStartSearchIF(final Discoverer d, final boolean usesMulticast)
final List<Result<SearchResponse>> search = d.getSearchResponses();
assertFalse(search.isEmpty(), "search results > 0");
for (final Result<SearchResponse> result : search) {
final SearchResponse response = result.getResponse();
final SearchResponse response = result.response();
assertNotNull(response);
}

Expand Down

0 comments on commit 8142e3d

Please sign in to comment.