* ONAP
* ================================================================================
* Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
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.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
-public class AlwaysSuccessLockTest extends AlwaysLockBaseTest<AlwaysSuccessLock> {
+class AlwaysSuccessLockTest extends AlwaysLockBaseTest<AlwaysSuccessLock> {
- @Before
+ @BeforeEach
public void setUp() {
callback = mock(LockCallback.class);
lock = new AlwaysSuccessLock(RESOURCE, OWNER_KEY, HOLD_SEC, callback);
}
@Test
- public void testAlwaysSuccessLockConstructors() {
+ void testAlwaysSuccessLockConstructors() {
assertThatCode(AlwaysSuccessLock::new).doesNotThrowAnyException();
assertThatCode(() -> new AlwaysSuccessLock(LockState.ACTIVE, RESOURCE, OWNER_KEY, HOLD_SEC, callback))
.doesNotThrowAnyException();
}
@Test
- public void testActiveLock() {
+ void testActiveLock() {
assertTrue(lock.isActive());
}
@Test
- public void testFree() {
+ void testFree() {
assertTrue(lock.free());
assertTrue(lock.isActive());
}
@Test
- public void testExtend() {
+ void testExtend() {
LockCallback callback2 = mock(LockCallback.class);
lock.extend(HOLD_SEC2, callback2);