Skip to content

Commit

Permalink
Apply Spotless
Browse files Browse the repository at this point in the history
Signed-off-by: Wouter Born <github@maindrain.net>
  • Loading branch information
wborn committed Jul 17, 2023
1 parent 2ee85a7 commit fb7d2fa
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,9 @@ public void setUp() {
when(thingHandlerFactoryMock.supportsThingType(eq(THING_TYPE_UID3))).thenReturn(true);
when(thingHandlerFactoryMock.createThing(any(ThingTypeUID.class), any(Configuration.class), any(ThingUID.class),
nullable(ThingUID.class)))
.then(invocation -> ThingBuilder
.create((ThingTypeUID) invocation.getArguments()[0],
(ThingUID) invocation.getArguments()[2])
.withConfiguration((Configuration) invocation.getArguments()[1]).build());
.then(invocation -> ThingBuilder
.create((ThingTypeUID) invocation.getArguments()[0], (ThingUID) invocation.getArguments()[2])
.withConfiguration((Configuration) invocation.getArguments()[1]).build());

inbox = new PersistentInbox(new VolatileStorageService(), mock(DiscoveryServiceRegistry.class),
thingRegistryMock, thingProviderMock, thingTypeRegistryMock, configDescriptionRegistryMock);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public void setup() {
when(thingHandlerFactoryMock.createThing(eq(THING_TYPE_UID), any(Configuration.class), eq(THING_UID), any()))
.then(invocation -> ThingBuilder.create(THING_TYPE_UID, "test")
.withConfiguration((Configuration) invocation.getArguments()[1]).build());
when(thingHandlerFactoryMock
.createThing(eq(THING_TYPE_UID), any(Configuration.class), eq(THING_OTHER_UID), any()))
.then(invocation -> ThingBuilder.create(THING_TYPE_UID, THING_OTHER_ID)
.withConfiguration((Configuration) invocation.getArguments()[1]).build());
when(thingHandlerFactoryMock.createThing(eq(THING_TYPE_UID), any(Configuration.class), eq(THING_OTHER_UID),
any()))
.then(invocation -> ThingBuilder.create(THING_TYPE_UID, THING_OTHER_ID)
.withConfiguration((Configuration) invocation.getArguments()[1]).build());
inbox = new PersistentInbox(storageServiceMock, mock(DiscoveryServiceRegistry.class), thingRegistryMock,
thingProviderMock, thingTypeRegistryMock, configDescriptionRegistryMock);
inbox.addThingHandlerFactory(thingHandlerFactoryMock);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void createWebsocketUsingDefaultAdapterPath() throws URISyntaxException {

@Test
public void createWebsocketUsingAdapterPath() throws URISyntaxException {
when(request.getRequestURI()).thenReturn(new URI("http://127.0.0.1:8080/ws/"+ testAdapterId));
when(request.getRequestURI()).thenReturn(new URI("http://127.0.0.1:8080/ws/" + testAdapterId));
webSocketCreatorAC.getValue().createWebSocket(request, response);
verify(testWsAdapter, times(1)).createWebSocket(request, response);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class PersistenceEqualsFilterTest {

@ParameterizedTest
@MethodSource("argumentProvider")
public void equalsFilterTest(State state, Collection<String> values, boolean expected) {
public void equalsFilterTest(State state, Collection<String> values, boolean expected) {
when(item.getState()).thenReturn(state);

PersistenceEqualsFilter filter = new PersistenceEqualsFilter("filter", values, false);
Expand All @@ -62,7 +62,7 @@ public void equalsFilterTest(State state, Collection<String> values, boolean ex

@ParameterizedTest
@MethodSource("argumentProvider")
public void notEqualsFilterTest(State state, Collection<String> values, boolean expected) {
public void notEqualsFilterTest(State state, Collection<String> values, boolean expected) {
when(item.getState()).thenReturn(state);

PersistenceEqualsFilter filter = new PersistenceEqualsFilter("filter", values, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class PersistenceIncludeFilterTest {

@ParameterizedTest
@MethodSource("argumentProvider")
public void includeFilterTest(State state, BigDecimal lower, BigDecimal upper, String unit, boolean expected) {
public void includeFilterTest(State state, BigDecimal lower, BigDecimal upper, String unit, boolean expected) {
when(item.getState()).thenReturn(state);

PersistenceIncludeFilter filter = new PersistenceIncludeFilter("filter", lower, upper, unit, false);
Expand All @@ -57,7 +57,7 @@ public void includeFilterTest(State state, BigDecimal lower, BigDecimal upper,

@ParameterizedTest
@MethodSource("notArgumentProvider")
public void notIncludeFilterTest(State state, BigDecimal lower, BigDecimal upper, String unit, boolean expected) {
public void notIncludeFilterTest(State state, BigDecimal lower, BigDecimal upper, String unit, boolean expected) {
when(item.getState()).thenReturn(state);

PersistenceIncludeFilter filter = new PersistenceIncludeFilter("filter", lower, upper, unit, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public void setup() {
@Test
public void testAutoUpdateVetoFromChannelType() {
when(channelTypeRegistry.getChannelType(any(ChannelTypeUID.class)))
.thenReturn(ChannelTypeBuilder.state(CHANNEL_TYPE_UID, "label", CoreItemFactory.SWITCH).withAutoUpdatePolicy(AutoUpdatePolicy.VETO).build());
.thenReturn(ChannelTypeBuilder.state(CHANNEL_TYPE_UID, "label", CoreItemFactory.SWITCH)
.withAutoUpdatePolicy(AutoUpdatePolicy.VETO).build());

autoUpdateManager.receiveCommand(ItemEventFactory.createCommandEvent(ITEM_NAME, OnOffType.ON), item);

Expand Down

0 comments on commit fb7d2fa

Please sign in to comment.