diff options
author | Jim Hahn <jrh3@att.com> | 2021-08-24 13:20:26 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-08-24 15:51:34 -0400 |
commit | dc101c2ad5e27d5a0afd4e2feeb8885f24728806 (patch) | |
tree | 939e6f3690d1a9c6e63c4226a85fbda8c238d65a /auth/cli-codegen/src/test | |
parent | 53fe02c107eae2f45abfee02e5b56a8ab3c09523 (diff) |
Use CompareToBuilder
Also added lombok to test classes.
Issue-ID: POLICY-3391
Change-Id: I9ecf479f3861a2e5211b037e885029d1719b6a56
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'auth/cli-codegen/src/test')
2 files changed, 12 insertions, 31 deletions
diff --git a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/DummyStErrorListener.java b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/DummyStErrorListener.java index 45d307b47..572b40e74 100644 --- a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/DummyStErrorListener.java +++ b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/DummyStErrorListener.java @@ -1,25 +1,29 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2021 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. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ package org.onap.policy.apex.auth.clicodegen; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.Setter; import org.stringtemplate.v4.STErrorListener; import org.stringtemplate.v4.misc.STMessage; @@ -31,6 +35,8 @@ import org.stringtemplate.v4.misc.STMessage; public class DummyStErrorListener implements STErrorListener { /** Counts errors of the listener. */ + @Getter(AccessLevel.PROTECTED) + @Setter(AccessLevel.PROTECTED) private int errorCount; /** @@ -90,22 +96,4 @@ public class DummyStErrorListener implements STErrorListener { setErrorCount(getErrorCount() + 1); System.err.println("STG/ST (" + msg.error + ") " + msg.arg + " -> " + msg.cause); } - - /** - * Gets the error count. - * - * @return the error count - */ - protected int getErrorCount() { - return errorCount; - } - - /** - * Sets the error count. - * - * @param errorCount the new error count - */ - protected void setErrorCount(final int errorCount) { - this.errorCount = errorCount; - } } diff --git a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/SupportKeyInfoGetter.java b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/SupportKeyInfoGetter.java index 5547aa4f7..567991666 100644 --- a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/SupportKeyInfoGetter.java +++ b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/SupportKeyInfoGetter.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2021 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. @@ -20,6 +21,7 @@ package org.onap.policy.apex.auth.clicodegen; +import lombok.AllArgsConstructor; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo; import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey; @@ -30,22 +32,13 @@ import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; * * @author John Keeney (john.keeney@ericsson.com) */ - +@AllArgsConstructor public class SupportKeyInfoGetter { /** The policy model for the getters. */ private final AxPolicyModel model; /** - * Creates a new key getter. - * - * @param model the policy model to use - */ - public SupportKeyInfoGetter(final AxPolicyModel model) { - this.model = model; - } - - /** * Returns the key name as string. * * @param key the key to transform |