2 * Copyright (c) 2010-2021 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.persistence.dynamodb.internal;
15 import static org.junit.jupiter.api.Assertions.assertEquals;
17 import java.io.IOException;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.junit.jupiter.api.Test;
21 import org.openhab.core.library.items.CallItem;
22 import org.openhab.core.library.items.ColorItem;
23 import org.openhab.core.library.items.ContactItem;
24 import org.openhab.core.library.items.DateTimeItem;
25 import org.openhab.core.library.items.DimmerItem;
26 import org.openhab.core.library.items.LocationItem;
27 import org.openhab.core.library.items.NumberItem;
28 import org.openhab.core.library.items.PlayerItem;
29 import org.openhab.core.library.items.RollershutterItem;
30 import org.openhab.core.library.items.StringItem;
31 import org.openhab.core.library.items.SwitchItem;
34 * Test for AbstractDynamoDBItem.getDynamoItemClass
36 * @author Sami Salonen - Initial contribution
39 public class AbstractDynamoDBItemGetDynamoItemClassTest {
42 public void testCallItem() throws IOException {
43 assertEquals(DynamoDBStringItem.class, AbstractDynamoDBItem.getDynamoItemClass(CallItem.class));
47 public void testContactItem() throws IOException {
48 assertEquals(DynamoDBBigDecimalItem.class, AbstractDynamoDBItem.getDynamoItemClass(ContactItem.class));
52 public void testDateTimeItem() throws IOException {
53 assertEquals(DynamoDBStringItem.class, AbstractDynamoDBItem.getDynamoItemClass(DateTimeItem.class));
57 public void testStringItem() throws IOException {
58 assertEquals(DynamoDBStringItem.class, AbstractDynamoDBItem.getDynamoItemClass(StringItem.class));
62 public void testLocationItem() throws IOException {
63 assertEquals(DynamoDBStringItem.class, AbstractDynamoDBItem.getDynamoItemClass(LocationItem.class));
67 public void testNumberItem() throws IOException {
68 assertEquals(DynamoDBBigDecimalItem.class, AbstractDynamoDBItem.getDynamoItemClass(NumberItem.class));
72 public void testColorItem() throws IOException {
73 assertEquals(DynamoDBStringItem.class, AbstractDynamoDBItem.getDynamoItemClass(ColorItem.class));
77 public void testDimmerItem() throws IOException {
78 assertEquals(DynamoDBBigDecimalItem.class, AbstractDynamoDBItem.getDynamoItemClass(DimmerItem.class));
82 public void testPlayerItem() throws IOException {
83 assertEquals(DynamoDBStringItem.class, AbstractDynamoDBItem.getDynamoItemClass(PlayerItem.class));
87 public void testRollershutterItem() throws IOException {
88 assertEquals(DynamoDBBigDecimalItem.class, AbstractDynamoDBItem.getDynamoItemClass(RollershutterItem.class));
92 public void testOnOffTypeWithSwitchItem() throws IOException {
93 assertEquals(DynamoDBBigDecimalItem.class, AbstractDynamoDBItem.getDynamoItemClass(SwitchItem.class));