Add a test to return a value that could potentially be null
Change-Id: I092ba4f21775ae64aa86f8dbff8538e47ca16c43
Issue-Id: CLAMP-43
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
*/
public static CldsModel createUsingControlName(String fullControlName) {
if (fullControlName == null || fullControlName.length() < UUID_LENGTH) {
*/
public static CldsModel createUsingControlName(String fullControlName) {
if (fullControlName == null || fullControlName.length() < UUID_LENGTH) {
- throw new BadRequestException("closed loop id / control name length, " + fullControlName.length()
- + ", less than the minimum of: " + UUID_LENGTH);
+ throw new BadRequestException(
+ "closed loop id / control name length, " + (fullControlName != null ? fullControlName.length() : 0)
+ + ", less than the minimum of: " + UUID_LENGTH);
}
CldsModel model = new CldsModel();
model.setControlNamePrefix(fullControlName.substring(0, fullControlName.length() - UUID_LENGTH));
}
CldsModel model = new CldsModel();
model.setControlNamePrefix(fullControlName.substring(0, fullControlName.length() - UUID_LENGTH));