}
}
private TModel saveTModel(String authInfo, TModel tmIn, boolean force) {
boolean exists = false;
GetTModelDetail gt1 = new GetTModelDetail();
gt1.getTModelKey().add(tmIn.getTModelKey());
try {
TModelDetail td1 = inquiry.getTModelDetail(gt1);
if (td1 != null && !td1.getTModel().isEmpty()) {
if (!td1.getTModel().get(0).isDeleted()) {
exists = true;
} else {
logger.info("The tModel with key " + tmIn.getTModelKey() + " exists already, but is flagged as deleted. Overwritting");
}
}
} catch (Exception ex) {
}
if (!exists || force) // Add the tModel
{
try {
SaveTModel st = new SaveTModel();
st.setAuthInfo(authInfo);
st.getTModel().add(tmIn);
publication.saveTModel(st);
keyscreated.add(tmIn.getTModelKey());
// Now get the entity and check the values
GetTModelDetail gt = new GetTModelDetail();
gt.getTModelKey().add(tmIn.getTModelKey());
TModelDetail td = inquiry.getTModelDetail(gt);
List<org.uddi.api_v3.TModel> tmOutList = td.getTModel();
org.uddi.api_v3.TModel tmOut = tmOutList.get(0);
assertEquals(tmIn.getTModelKey().toLowerCase(), tmOut.getTModelKey());