19
19
import static org .mockito .Mockito .*;
20
20
21
21
import java .time .ZoneId ;
22
- import java .time .ZoneOffset ;
23
22
import java .time .ZonedDateTime ;
24
23
import java .time .format .DateTimeFormatter ;
25
24
import java .util .Locale ;
30
29
import org .junit .jupiter .api .AfterEach ;
31
30
import org .junit .jupiter .api .BeforeAll ;
32
31
import org .junit .jupiter .api .BeforeEach ;
33
- import org .junit .jupiter .api .Disabled ;
34
32
import org .junit .jupiter .api .Test ;
35
33
import org .mockito .ArgumentMatchers ;
36
34
import org .openhab .binding .ntp .internal .NtpBindingConstants ;
@@ -209,35 +207,6 @@ public void testStringChannelTimeZoneUpdate() {
209
207
assertThat (timeZoneFromItemRegistry , is (anyOf (equalTo (expectedTimeZonePDT ), equalTo (expectedTimeZonePST ))));
210
208
}
211
209
212
- @ Test
213
- public void testDateTimeChannelTimeZoneUpdate () {
214
- Configuration configuration = new Configuration ();
215
- configuration .put (NtpBindingConstants .PROPERTY_TIMEZONE , TEST_TIME_ZONE_ID );
216
- initialize (configuration , NtpBindingConstants .CHANNEL_DATE_TIME , ACCEPTED_ITEM_TYPE_DATE_TIME , null , null );
217
-
218
- String testItemState = getItemState (ACCEPTED_ITEM_TYPE_DATE_TIME ).toString ();
219
- assertFormat (testItemState , DateTimeType .DATE_PATTERN_WITH_TZ_AND_MS );
220
- ZonedDateTime timeZoneFromItemRegistry = ((DateTimeType ) getItemState (ACCEPTED_ITEM_TYPE_DATE_TIME ))
221
- .getZonedDateTime ();
222
-
223
- ZoneOffset expectedOffset = ZoneId .of (TEST_TIME_ZONE_ID ).getRules ()
224
- .getOffset (timeZoneFromItemRegistry .toInstant ());
225
- assertEquals (expectedOffset , timeZoneFromItemRegistry .getOffset ());
226
- }
227
-
228
- @ Test
229
- public void testDateTimeChannelCalendarTimeZoneUpdate () {
230
- Configuration configuration = new Configuration ();
231
- configuration .put (NtpBindingConstants .PROPERTY_TIMEZONE , TEST_TIME_ZONE_ID );
232
- initialize (configuration , NtpBindingConstants .CHANNEL_DATE_TIME , ACCEPTED_ITEM_TYPE_DATE_TIME , null , null );
233
- ZonedDateTime timeZoneIdFromItemRegistry = ((DateTimeType ) getItemState (ACCEPTED_ITEM_TYPE_DATE_TIME ))
234
- .getZonedDateTime ();
235
-
236
- ZoneOffset expectedOffset = ZoneId .of (TEST_TIME_ZONE_ID ).getRules ()
237
- .getOffset (timeZoneIdFromItemRegistry .toInstant ());
238
- assertEquals (expectedOffset , timeZoneIdFromItemRegistry .getOffset ());
239
- }
240
-
241
210
@ Test
242
211
public void testStringChannelDefaultTimeZoneUpdate () {
243
212
final String expectedTimeZoneEEST = "EEST" ;
@@ -259,36 +228,6 @@ public void testStringChannelDefaultTimeZoneUpdate() {
259
228
assertThat (timeZoneFromItemRegistry , is (anyOf (equalTo (expectedTimeZoneEEST ), equalTo (expectedTimeZoneEET ))));
260
229
}
261
230
262
- @ Test
263
- public void testDateTimeChannelDefaultTimeZoneUpdate () {
264
- ZonedDateTime zoned = ZonedDateTime .now ();
265
-
266
- ZoneOffset expectedTimeZone = zoned .getOffset ();
267
- Configuration configuration = new Configuration ();
268
- // Initialize with configuration with no time zone property set.
269
- initialize (configuration , NtpBindingConstants .CHANNEL_DATE_TIME , ACCEPTED_ITEM_TYPE_DATE_TIME , null , null );
270
-
271
- String testItemState = getItemState (ACCEPTED_ITEM_TYPE_DATE_TIME ).toString ();
272
- assertFormat (testItemState , DateTimeType .DATE_PATTERN_WITH_TZ_AND_MS );
273
- ZoneOffset timeZoneFromItemRegistry = new DateTimeType (testItemState ).getZonedDateTime ().getOffset ();
274
-
275
- assertEquals (expectedTimeZone , timeZoneFromItemRegistry );
276
- }
277
-
278
- @ Test
279
- @ Disabled ("https://github.com/eclipse/smarthome/issues/5224" )
280
- public void testDateTimeChannelCalendarDefaultTimeZoneUpdate () {
281
- Configuration configuration = new Configuration ();
282
- // Initialize with configuration with no time zone property set.
283
- initialize (configuration , NtpBindingConstants .CHANNEL_DATE_TIME , ACCEPTED_ITEM_TYPE_DATE_TIME , null , null );
284
-
285
- ZonedDateTime timeZoneIdFromItemRegistry = ((DateTimeType ) getItemState (ACCEPTED_ITEM_TYPE_DATE_TIME ))
286
- .getZonedDateTime ();
287
-
288
- ZoneOffset expectedOffset = ZoneId .systemDefault ().getRules ().getOffset (timeZoneIdFromItemRegistry .toInstant ());
289
- assertEquals (expectedOffset , timeZoneIdFromItemRegistry .getOffset ());
290
- }
291
-
292
231
@ Test
293
232
public void testStringChannelFormatting () {
294
233
final String formatPattern = "EEE, d MMM yyyy HH:mm:ss z" ;
0 commit comments