]> git.basschouten.com Git - openhab-addons.git/blob
4d35c367b7d422c63a29e8756352ef3ba47eed65
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.satel.internal.util;
14
15 import static org.junit.jupiter.api.Assertions.*;
16
17 import org.junit.jupiter.api.Test;
18
19 /**
20  * @author Krzysztof Goworek - Initial contribution
21  */
22 public class StringUtilsTest {
23
24     @Test
25     public void testIsEmpty() {
26         assertFalse(StringUtils.isEmpty("foobar"));
27         assertFalse(StringUtils.isEmpty("  "));
28         assertTrue(StringUtils.isEmpty(""));
29         assertTrue(StringUtils.isEmpty(null));
30     }
31
32     @Test
33     public void testIsNotEmpty() {
34         assertTrue(StringUtils.isNotEmpty("foobar"));
35         assertTrue(StringUtils.isNotEmpty("  "));
36         assertFalse(StringUtils.isNotEmpty(""));
37         assertFalse(StringUtils.isNotEmpty(null));
38     }
39
40     @Test
41     public void testIsBlank() {
42         assertFalse(StringUtils.isBlank("foobar"));
43         assertTrue(StringUtils.isBlank("  "));
44         assertTrue(StringUtils.isBlank(""));
45         assertTrue(StringUtils.isBlank(null));
46     }
47
48     @Test
49     public void testIsNotBlank() {
50         assertTrue(StringUtils.isNotBlank("foobar"));
51         assertFalse(StringUtils.isNotBlank("  "));
52         assertFalse(StringUtils.isNotBlank(""));
53         assertFalse(StringUtils.isNotBlank(null));
54     }
55 }