From ea6f93d6f1a3afce1be185bef2d0e38be7fbfdd2 Mon Sep 17 00:00:00 2001 From: "Claudio Maggioni (maggicl)" Date: Wed, 27 May 2020 22:06:52 +0200 Subject: [PATCH] Four letters can change the behaviour of a piece of code a lot --- .../smarthut/service/DevicePropagationService.java | 2 +- .../smarthut/service/DevicePropagationServiceTests.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/service/DevicePropagationService.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/service/DevicePropagationService.java index 3f2ed0e..9f7846c 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/service/DevicePropagationService.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/service/DevicePropagationService.java @@ -148,7 +148,7 @@ public class DevicePropagationService { } if (causedByTrigger) { - endpoint.queueDeviceUpdate(device, user, false, user.getId(), false); + endpoint.queueDeviceUpdate(device, user, false, null, false); } } } diff --git a/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/service/DevicePropagationServiceTests.java b/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/service/DevicePropagationServiceTests.java index 47de5e1..a0d126d 100644 --- a/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/service/DevicePropagationServiceTests.java +++ b/src/test/java/ch/usi/inf/sa4/sanmarinoes/smarthut/service/DevicePropagationServiceTests.java @@ -210,9 +210,7 @@ public class DevicePropagationServiceTests { doAnswer(i -> counter[0]++) .when(endpoint) .queueDeviceUpdate(d, guest, false, host.getId(), false); - doAnswer(i -> counter[0]++) - .when(endpoint) - .queueDeviceUpdate(d, host, false, host.getId(), false); + doAnswer(i -> counter[0]++).when(endpoint).queueDeviceUpdate(d, host, false, null, false); devicePropagationService.propagateUpdateAsOwner(d, "host", false); assertThat(counter[0]).isEqualTo(1);