The unit test class PIPConfigurationTest.java has a test that checks a
configuration string for length. However, the length of the "piptype"
field in that string can vary, causing the test to intermittently fail.
Field that passes:
piptype=org.onap.policy.rest.jpa.PIPType@
71b3bc45
Field that fails:
piptype=org.onap.policy.rest.jpa.PIPType@
a8c1f44
This fix removes the memory address from the "piptype" field, so that the configuration string will
now always be 323 characters in length.
Change-Id: Ib3640ec6f69ac7d691dcc989c44a7822bcc9b7f7
Issue-ID: POLICY-765
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
assertEquals(id, config.getName());
// Test toString
- assertEquals(332, config.toString().length());
+ String configString = config.toString().replaceAll("@[0-9a-f]*", "");
+ assertEquals(323, configString.length());
}
}