From c198a96ec51dd9fd1010f44f208bc93a4c035930 Mon Sep 17 00:00:00 2001 From: Muhammed Almas Date: Tue, 7 Feb 2017 02:33:47 +0530 Subject: [PATCH] Pre conditions (#1128) * BAL-36 File size api in java and apache commons IO * BAEL-282 grep in java - fixes after code review * BAEL-519 Added support for disruptor library * BAEL-519 Added support for disruptor library * BAEL-519 Added support for disruptor library * BAEL-519 Added support for disruptor library * BAEL-519 Added support for disruptor library * BAEL-519 Added support for disruptor library * BAEL-519 Added support for disruptor * BAEL-519 Moved all supporting classes to main source * BAEL-519 Moved all supporting classes to main source * BAEL-519 Moved asserts and test classes in test folder. * BAEL-519 moved test related producer and consumer to src. * BAEL-586 Guide to Guava BiMap. * BAEL-587 formatted code. * BAEL-519 LMAX Disruptor * BAEL-587 resolved merge * BAEL-587 Resolved merge * BAEL-519 Removed disruptor link. * BAEL-519 Reverted Guava changes * RFQ-587 Added disruptor as a separate module. * BAEL-519 Disruptor changes. * BAEL-519 Removed disruptor from core-java module. * BAEL-637 Guide to PreConditions * BAEL-637 Used assertJ for exception assertion. * BAEL-637 updated tests to use assertJ. * BAEL-637 Removed redundant tests. * BAEL-637 explicitely specify the null varargs. * BAEL-637 explicitely specify the null varargs. --- .../java/org/baeldung/guava/GuavaPreConditionsTest.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/guava/src/test/java/org/baeldung/guava/GuavaPreConditionsTest.java b/guava/src/test/java/org/baeldung/guava/GuavaPreConditionsTest.java index f231fdda9d..2d98418d48 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaPreConditionsTest.java +++ b/guava/src/test/java/org/baeldung/guava/GuavaPreConditionsTest.java @@ -1,12 +1,9 @@ package org.baeldung.guava; import static org.assertj.core.api.Assertions.assertThatThrownBy; - import java.util.Arrays; - import org.junit.Test; - -import com.google.common.base.Preconditions; +import com.google.common.base.*; public class GuavaPreConditionsTest { @@ -61,7 +58,7 @@ public class GuavaPreConditionsTest { final String nullObject = null; final String message = "Please check the Object supplied, its %s!"; - assertThatThrownBy(() -> Preconditions.checkNotNull(nullObject, message, nullObject)).isInstanceOf(NullPointerException.class).hasMessage(message, nullObject).hasNoCause(); + assertThatThrownBy(() -> Preconditions.checkNotNull(nullObject, message, new Object[] { null })).isInstanceOf(NullPointerException.class).hasMessage(message, nullObject).hasNoCause(); } @Test