Use Eclipse formatter 4.25 with Spotless (#3710)

Fixes #3515

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born 2023-07-18 09:03:16 +02:00 committed by GitHub
parent 2ee85a75f5
commit 3396ff7758
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 16 deletions

View File

@ -137,10 +137,9 @@ public class AutomaticInboxProcessorTest {
when(thingHandlerFactoryMock.supportsThingType(eq(THING_TYPE_UID3))).thenReturn(true); when(thingHandlerFactoryMock.supportsThingType(eq(THING_TYPE_UID3))).thenReturn(true);
when(thingHandlerFactoryMock.createThing(any(ThingTypeUID.class), any(Configuration.class), any(ThingUID.class), when(thingHandlerFactoryMock.createThing(any(ThingTypeUID.class), any(Configuration.class), any(ThingUID.class),
nullable(ThingUID.class))) nullable(ThingUID.class)))
.then(invocation -> ThingBuilder .then(invocation -> ThingBuilder
.create((ThingTypeUID) invocation.getArguments()[0], .create((ThingTypeUID) invocation.getArguments()[0], (ThingUID) invocation.getArguments()[2])
(ThingUID) invocation.getArguments()[2]) .withConfiguration((Configuration) invocation.getArguments()[1]).build());
.withConfiguration((Configuration) invocation.getArguments()[1]).build());
inbox = new PersistentInbox(new VolatileStorageService(), mock(DiscoveryServiceRegistry.class), inbox = new PersistentInbox(new VolatileStorageService(), mock(DiscoveryServiceRegistry.class),
thingRegistryMock, thingProviderMock, thingTypeRegistryMock, configDescriptionRegistryMock); thingRegistryMock, thingProviderMock, thingTypeRegistryMock, configDescriptionRegistryMock);

View File

@ -97,10 +97,10 @@ public class PersistentInboxTest {
when(thingHandlerFactoryMock.createThing(eq(THING_TYPE_UID), any(Configuration.class), eq(THING_UID), any())) when(thingHandlerFactoryMock.createThing(eq(THING_TYPE_UID), any(Configuration.class), eq(THING_UID), any()))
.then(invocation -> ThingBuilder.create(THING_TYPE_UID, "test") .then(invocation -> ThingBuilder.create(THING_TYPE_UID, "test")
.withConfiguration((Configuration) invocation.getArguments()[1]).build()); .withConfiguration((Configuration) invocation.getArguments()[1]).build());
when(thingHandlerFactoryMock when(thingHandlerFactoryMock.createThing(eq(THING_TYPE_UID), any(Configuration.class), eq(THING_OTHER_UID),
.createThing(eq(THING_TYPE_UID), any(Configuration.class), eq(THING_OTHER_UID), any())) any()))
.then(invocation -> ThingBuilder.create(THING_TYPE_UID, THING_OTHER_ID) .then(invocation -> ThingBuilder.create(THING_TYPE_UID, THING_OTHER_ID)
.withConfiguration((Configuration) invocation.getArguments()[1]).build()); .withConfiguration((Configuration) invocation.getArguments()[1]).build());
inbox = new PersistentInbox(storageServiceMock, mock(DiscoveryServiceRegistry.class), thingRegistryMock, inbox = new PersistentInbox(storageServiceMock, mock(DiscoveryServiceRegistry.class), thingRegistryMock,
thingProviderMock, thingTypeRegistryMock, configDescriptionRegistryMock); thingProviderMock, thingTypeRegistryMock, configDescriptionRegistryMock);
inbox.addThingHandlerFactory(thingHandlerFactoryMock); inbox.addThingHandlerFactory(thingHandlerFactoryMock);

View File

@ -92,7 +92,7 @@ public class CommonWebSocketServletTest {
@Test @Test
public void createWebsocketUsingAdapterPath() throws URISyntaxException { 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); webSocketCreatorAC.getValue().createWebSocket(request, response);
verify(testWsAdapter, times(1)).createWebSocket(request, response); verify(testWsAdapter, times(1)).createWebSocket(request, response);
} }

View File

@ -53,7 +53,7 @@ public class PersistenceEqualsFilterTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("argumentProvider") @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); when(item.getState()).thenReturn(state);
PersistenceEqualsFilter filter = new PersistenceEqualsFilter("filter", values, false); PersistenceEqualsFilter filter = new PersistenceEqualsFilter("filter", values, false);
@ -62,7 +62,7 @@ public class PersistenceEqualsFilterTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("argumentProvider") @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); when(item.getState()).thenReturn(state);
PersistenceEqualsFilter filter = new PersistenceEqualsFilter("filter", values, true); PersistenceEqualsFilter filter = new PersistenceEqualsFilter("filter", values, true);

View File

@ -48,7 +48,7 @@ public class PersistenceIncludeFilterTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("argumentProvider") @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); when(item.getState()).thenReturn(state);
PersistenceIncludeFilter filter = new PersistenceIncludeFilter("filter", lower, upper, unit, false); PersistenceIncludeFilter filter = new PersistenceIncludeFilter("filter", lower, upper, unit, false);
@ -57,7 +57,7 @@ public class PersistenceIncludeFilterTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("notArgumentProvider") @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); when(item.getState()).thenReturn(state);
PersistenceIncludeFilter filter = new PersistenceIncludeFilter("filter", lower, upper, unit, true); PersistenceIncludeFilter filter = new PersistenceIncludeFilter("filter", lower, upper, unit, true);

View File

@ -97,7 +97,8 @@ public class AutoUpdateManagerTest extends JavaTest {
@Test @Test
public void testAutoUpdateVetoFromChannelType() { public void testAutoUpdateVetoFromChannelType() {
when(channelTypeRegistry.getChannelType(any(ChannelTypeUID.class))) 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); autoUpdateManager.receiveCommand(ItemEventFactory.createCommandEvent(ITEM_NAME, OnOffType.ON), item);

View File

@ -77,8 +77,9 @@
<sat.version>0.15.0</sat.version> <sat.version>0.15.0</sat.version>
<slf4j.version>1.7.32</slf4j.version> <slf4j.version>1.7.32</slf4j.version>
<xtext.version>2.29.0</xtext.version> <xtext.version>2.29.0</xtext.version>
<spotless.version>2.35.0</spotless.version> <spotless.version>2.37.0</spotless.version>
<spotless.eclipse.version>4.26</spotless.eclipse.version> <!-- Eclipse Java formatter version 4.26+ does not check test files -->
<spotless.eclipse.version>4.25</spotless.eclipse.version>
<spotless.eclipse.wtp.version>4.21.0</spotless.eclipse.wtp.version> <spotless.eclipse.wtp.version>4.21.0</spotless.eclipse.wtp.version>
</properties> </properties>