• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wistefan / tmforum-api / #49

29 Sep 2023 06:20AM UTC coverage: 67.488% (-4.3%) from 71.815%
#49

push

web-flow
Notifications (#23)

* Squashed commits

* Added cache invalidation for entity deletion

* Updated error message

618 of 618 new or added lines in 86 files covered. (100.0%)

2794 of 4140 relevant lines covered (67.49%)

0.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

31.82
/common/src/main/java/org/fiware/tmforum/common/util/StringUtils.java
1
package org.fiware.tmforum.common.util;
2

3
import org.fiware.tmforum.common.notification.EventConstants;
4

5
import java.util.Arrays;
6

7
public class StringUtils {
×
8
    public static String toCamelCase(String dashedLowerCase) {
9
        if (dashedLowerCase == null || dashedLowerCase.isEmpty()) {
×
10
            return "";
×
11
        }
12
        return String.join("", Arrays.stream(dashedLowerCase.split("-"))
×
13
                .map(StringUtils::capitalize).toList());
×
14
    }
15

16
    public static String decapitalize(String string) {
17
        if (string == null || string.isEmpty()) {
×
18
            return string;
×
19
        }
20

21
        char[] c = string.toCharArray();
×
22
        c[0] = Character.toLowerCase(c[0]);
×
23

24
        return new String(c);
×
25
    }
26

27
    public static String capitalize(String string) {
28
        if (string == null || string.isEmpty()) {
×
29
            return string;
×
30
        }
31

32
        char[] c = string.toCharArray();
×
33
        c[0] = Character.toUpperCase(c[0]);
×
34

35
        return new String(c);
×
36
    }
37

38
    public static String getEventGroupName(String eventType) {
39
        return eventType
1✔
40
                .replace(EventConstants.CREATE_EVENT_SUFFIX, "")
1✔
41
                .replace(EventConstants.DELETE_EVENT_SUFFIX, "")
1✔
42
                .replace(EventConstants.STATE_CHANGE_EVENT_SUFFIX, "")
1✔
43
                .replace(EventConstants.ATTRIBUTE_VALUE_CHANGE_EVENT_SUFFIX, "")
1✔
44
                .replace(EventConstants.INFORMATION_REQUIRED_EVENT_SUFFIX, "")
1✔
45
                .replace(EventConstants.CHANGE_EVENT_SUFFIX, "");
1✔
46
    }
47
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc