-/*
+/*-
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * 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.
// no value in tree - text remains unchanged
text = INITIAL_VALUE;
deser.getFromTree(json, this);
- assertEquals(text, INITIAL_VALUE);
+ assertEquals(INITIAL_VALUE, text);
// null value in tree - text remains unchanged
json.add(TEXT_FIELD_NAME, JsonNull.INSTANCE);
deser.getFromTree(json, this);
- assertEquals(text, INITIAL_VALUE);
+ assertEquals(INITIAL_VALUE, text);
// now assign a value - text should be changed now
json.addProperty(TEXT_FIELD_NAME, NEW_VALUE);
deser.getFromTree(json, this);
- assertEquals(text, NEW_VALUE);
+ assertEquals(NEW_VALUE, text);
/*
* check list field
-/*
+/*--
* ============LICENSE_START=======================================================
* Integrity Audit
* ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-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.
*/
public DbAudit(DbDao dbDao) {
- if (logger.isDebugEnabled()) {
- logger.debug("Constructor: Entering");
- }
+ logger.debug("Constructor: Entering");
this.dbDao = dbDao;
- if (logger.isDebugEnabled()) {
- logger.debug("Constructor: Exiting");
- }
-
+ logger.debug("Constructor: Exiting");
}
/**
if (logger.isDebugEnabled()) {
logger.debug("dbAudit: Exiting");
}
-
- return; // all done
}
private void compareList(String persistenceUnit, List<IntegrityAuditEntity> iaeList, IntegrityAuditEntity myIae,
* again for all nodes later.
*/
compareMineWithTheirs(myEntries, theirEntries, clazzName, misMatchedMap);
- } // end for (IntegrityAuditEntity iae : iaeList)
+ }
}
private void compareMineWithTheirs(Map<Object, Object> myEntries, Map<Object, Object> theirEntries,
logger.debug("dbAudit: Second comparison; waking from sleep");
}
}
- } // end: for(String clazzName: classNameList)
+ }
if (errorCount != 0) {
String msg = " DB Audit: " + errorCount
}
// check the next group
- } // end for (String group : depGroups)
+ }
return dependencyOk;
}
appendSeparator(errorMsg);
errorMsg.append(failMsg);
}
- } // end for (String dep : dependencies)
+ }
// if all dependencies in a group are failed, set this
// resource's state to disable dependency
} catch (Exception e1) {
logger.error(EXCEPTION_STRING, e1);
}
- logger.error("writeFpc DB table commit failed with exception", e);
+ logger.error("writeFpc DB table commit failed with exception");
throw e;
}
}
if (sme != null && !sme.getOpState().equals(StateManagement.DISABLED)) {
disableFailed(sme);
}
- } // end if(diffMs > staleMs)
- } // end for(ForwardProgressEntity fpe : fpList)
+ }
+ }
logger.debug("IntegrityMonitor.executeStateAudit(): exit");
}
allNotWellMap = new HashMap<>();
}
- if (asw) {
+ if (Boolean.TRUE.equals(asw)) {
logger.info("allSeemsWell: ALL SEEMS WELL: key = {}, msg = {}", key, msg);
allSeemsWellMap.put(key, msg);
allNotWellMap.remove(key);
logger.debug("StateManagement: {}() operation completed, resourceName = {}",
methodName, resourceName);
} catch (final Exception ex) {
- logger.error("StateManagement.{}() caught unexpected exception: ", methodName, ex);
throw new StateManagementException("StateManagement." + methodName + "() Exception: " + ex);
}
}
}
} catch (final Exception ex) {
final String message = "findStateManagementEntity exception";
- logger.error("{}: {}", message, ex.toString(), ex);
throw new EntityRetrievalException(message, ex);
}
}
* ============LICENSE_START=======================================================
* policy-endpoints
* ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2018-2019 Samsung Electronics Co., Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* Not to be converted to PolicyLogger. This will contain all instract /out traffic and only
* that in a single file in a concise format.
*/
- private static Logger logger = LoggerFactory.getLogger(InlineBusTopicSink.class);
+ private static Logger logger = LoggerFactory.getLogger(SingleThreadedBusTopicSource.class);
/**
* Bus consumer group.
logger.info("{}: register: start not attempted", this);
}
} catch (Exception e) {
- logger.warn("{}: cannot start after registration of because of: {}", this, topicListener, e.getMessage(),
- e);
+ logger.warn("{}: cannot start after registration of because of: {}", this, topicListener, e);
}
}
busPollerThread.start();
return true;
} catch (Exception e) {
- logger.warn("{}: cannot start because of {}", this, e.getMessage(), e);
- throw new IllegalStateException(e);
+ throw new IllegalStateException(this + ": cannot start", e);
}
}
}
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2018-2019 Samsung Electronics Co., Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
try {
this.init();
} catch (Exception e) {
- logger.error("ERROR during init in dmaap-source: cannot create topic {} because of {}",
- topic, e.getMessage(), e);
- throw new IllegalArgumentException(e);
+ throw new IllegalArgumentException("ERROR during init in dmaap-source: cannot create topic " + topic, e);
}
}
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-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 java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import lombok.Getter;
-import org.onap.policy.common.utils.time.TestTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
long realEnd = System.currentTimeMillis() + maxWaitMs;
while (System.currentTimeMillis() < realEnd) {
- if (condition.call()) {
+ if (Boolean.TRUE.equals(condition.call())) {
return;
}
-/*
+/*--
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * 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 lombok.AccessLevel;
import lombok.Getter;
-import org.onap.policy.common.utils.time.TestTime;
/**
* Work item to be executed at some time.
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * 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.
package org.onap.policy.common.utils.time;
+import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@Test
public void testFire() {
// ensure no exception is thrown
- item.fire();
+ assertThatCode(() -> item.fire()).doesNotThrowAnyException();
}
@Test