import java.util.Collections;
import java.util.List;
import java.util.Map.Entry;
+import lombok.AccessLevel;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
import org.apache.commons.jexl3.JexlBuilder;
import org.apache.commons.jexl3.JexlContext;
import org.apache.commons.jexl3.JexlEngine;
/**
* Utilities used to test encoding and decoding of Policy objects.
*/
+@AllArgsConstructor(access = AccessLevel.PROTECTED)
public class GsonTestUtils {
private static final Logger logger = LoggerFactory.getLogger(GsonTestUtils.class);
/**
* Used to encode and decode an object via gson.
*/
+ @Getter
private Gson gson;
/**
gson = other.gson;
}
- /**
- * Constructs the object.
- *
- * @param gson used to encode via gson
- */
- protected GsonTestUtils(Gson gson) {
- this.gson = gson;
- }
-
- public Gson getGson() {
- return gson;
- }
-
/**
* Serializes and then deserializes an object using gson.
*
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
/**
* Utilities for testing serialization and de-serialization of objects.
*/
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Serializer {
/**
*/
private static Factory factory = new Factory();
- /**
- * The constructor.
- */
- private Serializer() {
-
- }
-
/**
* Serializes an object into a byte array.
*
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
import com.openpojo.validation.affirm.Affirm;
import com.openpojo.validation.test.Tester;
import com.openpojo.validation.utils.ValidationHelper;
+import lombok.AllArgsConstructor;
import org.hamcrest.Matcher;
*
* @author Ram Krishna Verma (ram.krishna.verma@est.tech)
*/
+@AllArgsConstructor
public class ToStringTester implements Tester {
private final Matcher<?> matcher;
matcher = anything();
}
- public ToStringTester(final Matcher<?> matcher) {
- this.matcher = matcher;
- }
-
@SuppressWarnings("unchecked")
@Override
public void run(final PojoClass pojoClass) {
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-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.
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;
+import lombok.Getter;
/**
* Scheduled executor service that uses {@link TestTimeMulti} to execute its tasks. Note:
* {@code True} if {@link #shutdown()} or {@link #shutdownNow()} has been called,
* {@code false} otherwise.
*/
+ @Getter
private boolean shutdown = false;
/**
.collect(Collectors.toList());
}
- @Override
- public boolean isShutdown() {
- return shutdown;
- }
-
@Override
public boolean isTerminated() {
return isShutdown();
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019, 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.
/**
* {@code True} if this task is periodic, {@code false} otherwise.
*/
+ @Getter
private final boolean periodic;
/**
return Long.compare(workItem.getDelay(), other.getDelay(TimeUnit.MILLISECONDS));
}
- @Override
- public boolean isPeriodic() {
- return periodic;
- }
-
@Override
public void run() {
if (isPeriodic()) {
* ============LICENSE_START=======================================================
* Common Utils-Test
* ================================================================================
- * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-2019, 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.
import java.util.Date;
import java.util.concurrent.atomic.AtomicLong;
+import lombok.NoArgsConstructor;
/**
* "Current" time, when running junit tests. This is intended to be injected into classes
* under test, to replace their {@link CurrentTime} objects. When {@link #sleep(long)} is
* invoked, it simply advances the notion of "current" time and returns immediately.
*/
+@NoArgsConstructor
public class TestTime extends CurrentTime {
/**
*/
private AtomicLong tcur = new AtomicLong(System.currentTimeMillis());
- /**
- * Constructor.
- *
- */
- public TestTime() {
- super();
- }
-
@Override
public long getMillis() {
return tcur.get();