mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
Simplify switch statements, Java 21 (#5012)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
+4
-7
@@ -176,13 +176,10 @@ public class CommunicationManagerOSGiTest extends JavaOSGiTest {
|
||||
itemStateConverterMock, eventPublisherMock, safeCaller, thingRegistryMock);
|
||||
|
||||
doAnswer(invocation -> {
|
||||
switch (((Channel) invocation.getArguments()[0]).getKind()) {
|
||||
case STATE:
|
||||
return new ProfileTypeUID("test:state");
|
||||
case TRIGGER:
|
||||
return new ProfileTypeUID("test:trigger");
|
||||
}
|
||||
return null;
|
||||
return switch (((Channel) invocation.getArguments()[0]).getKind()) {
|
||||
case STATE -> new ProfileTypeUID("test:state");
|
||||
case TRIGGER -> new ProfileTypeUID("test:trigger");
|
||||
};
|
||||
}).when(profileAdvisorMock).getSuggestedProfileTypeUID(isA(Channel.class), isA(String.class));
|
||||
doAnswer(invocation -> {
|
||||
switch (((ProfileTypeUID) invocation.getArguments()[0]).toString()) {
|
||||
|
||||
Reference in New Issue
Block a user