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.binding.satel.internal.util;
15 import static org.junit.jupiter.api.Assertions.*;
17 import org.junit.jupiter.api.Test;
20 * @author Krzysztof Goworek - Initial contribution
22 public class StringUtilsTest {
25 public void testIsEmpty() {
26 assertFalse(StringUtils.isEmpty("foobar"));
27 assertFalse(StringUtils.isEmpty(" "));
28 assertTrue(StringUtils.isEmpty(""));
29 assertTrue(StringUtils.isEmpty(null));
33 public void testIsNotEmpty() {
34 assertTrue(StringUtils.isNotEmpty("foobar"));
35 assertTrue(StringUtils.isNotEmpty(" "));
36 assertFalse(StringUtils.isNotEmpty(""));
37 assertFalse(StringUtils.isNotEmpty(null));
41 public void testIsBlank() {
42 assertFalse(StringUtils.isBlank("foobar"));
43 assertTrue(StringUtils.isBlank(" "));
44 assertTrue(StringUtils.isBlank(""));
45 assertTrue(StringUtils.isBlank(null));
49 public void testIsNotBlank() {
50 assertTrue(StringUtils.isNotBlank("foobar"));
51 assertFalse(StringUtils.isNotBlank(" "));
52 assertFalse(StringUtils.isNotBlank(""));
53 assertFalse(StringUtils.isNotBlank(null));