/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.models.base.PfModelException;
+import org.onap.policy.models.base.Validated;
import org.onap.policy.models.dao.DaoParameters;
import org.onap.policy.models.dao.PfDao;
import org.onap.policy.models.dao.PfDaoFactory;
pdpGroups0.getGroups().get(0).setPdpGroupState(null);
assertThatThrownBy(() -> {
new PdpProvider().createPdpGroups(pfDao, pdpGroups0.getGroups());
- }).hasMessageContaining("INVALID:pdpGroupState may not be null");
+ }).hasMessageContaining("PDP group").hasMessageContaining("pdpGroupState")
+ .hasMessageContaining(Validated.IS_NULL);
}
@Test
pdpGroups0.getGroups().get(0).setPdpGroupState(null);
assertThatThrownBy(() -> {
new PdpProvider().updatePdpGroups(pfDao, pdpGroups0.getGroups());
- }).hasMessageContaining("INVALID:pdpGroupState may not be null");
+ }).hasMessageContaining("PDP group").hasMessageContaining("pdpGroupState")
+ .hasMessageContaining(Validated.IS_NULL);
}
@Test
existingSubGroup.setDesiredInstanceCount(-1);
assertThatThrownBy(() -> {
new PdpProvider().updatePdpSubGroup(pfDao, PDP_GROUP0, existingSubGroup);
- }).hasMessageContaining("INVALID:the desired instance count of a PDP sub group may not be negative");
+ }).hasMessageContaining("PDP sub group").hasMessageContaining("desiredInstanceCount")
+ .hasMessageContaining("is negative");
existingSubGroup.setDesiredInstanceCount(10);
}
existingPdp.setMessage("");
assertThatThrownBy(() -> {
new PdpProvider().updatePdp(pfDao, PDP_GROUP0, "APEX", existingPdp);
- }).hasMessageContaining("INVALID:message may not be blank");
+ }).hasMessageContaining("PDP").hasMessageContaining("message").hasMessageContaining(Validated.IS_BLANK);
existingPdp.setMessage("A Message");
}