Skip to content

Commit bb45c2d

Browse files
committed
added lazyOf methods test
1 parent 8de17d4 commit bb45c2d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/test/java/com/plugatar/jkscope/LazyTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.junit.jupiter.api.Test;
2020

2121
import static com.plugatar.jkscope.JKScope.lazy;
22+
import static com.plugatar.jkscope.JKScope.lazyOf;
2223
import static org.assertj.core.api.Assertions.assertThat;
2324
import static org.assertj.core.api.Assertions.assertThatThrownBy;
2425
import static org.mockito.Mockito.doReturn;
@@ -172,4 +173,17 @@ void lazyMethodWithThreadSafetyModeAndSupplierUnsafeMode() {
172173
).isSameAs(result);
173174
verify(initializer, times(1)).get();
174175
}
176+
177+
@Test
178+
void lazyOfMethod() {
179+
final Object result = new Object();
180+
final Lazy<Object> lazy = lazyOf(result);
181+
182+
assertThat(
183+
lazy.get()
184+
).isSameAs(result);
185+
assertThat(
186+
lazy.get()
187+
).isSameAs(result);
188+
}
175189
}

0 commit comments

Comments
 (0)