<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
- <dependency>
- <groupId>org.opendaylight.infrautils</groupId>
- <artifactId>infrautils-testutils</artifactId>
- </dependency>
</dependencies>
</project>
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.genius.ipv6util.api;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
import org.junit.Test;
-import org.opendaylight.infrautils.testutils.Asserts;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address;
assertEquals(Ipv6Util.getFormattedIpAddress(IpAddressBuilder.getDefaultInstance("10.0.0.10")), "10.0.0.10");
// Negative cases
- Asserts.assertThrows(IllegalArgumentException.class, () -> {
+ assertThrows(IllegalArgumentException.class, () -> {
Ipv6Util.getFormattedIpAddress(IpAddressBuilder.getDefaultInstance("abcd-invalid"));
});
- Asserts.assertThrows(IllegalArgumentException.class, () -> {
+ assertThrows(IllegalArgumentException.class, () -> {
Ipv6Util.getFormattedIpAddress(IpAddressBuilder.getDefaultInstance("1001:db8:0:2::/64"));
});
- Asserts.assertThrows(IllegalArgumentException.class, () -> {
+ assertThrows(IllegalArgumentException.class, () -> {
Ipv6Util.getFormattedIpAddress(IpAddressBuilder.getDefaultInstance("20.0.0.10/24"));
});
}
"fe80:0:0:0:0:0:a00:27f1");
// Negative cases
- Asserts.assertThrows(IllegalArgumentException.class, () -> {
+ assertThrows(IllegalArgumentException.class, () -> {
Ipv6Util.getFormattedIpv6Address(Ipv6Address.getDefaultInstance("abcd-invalid"));
});
- Asserts.assertThrows(IllegalArgumentException.class, () -> {
+ assertThrows(IllegalArgumentException.class, () -> {
Ipv6Util.getFormattedIpv6Address(Ipv6Address.getDefaultInstance("1001:db8:0:2::/64"));
});
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.genius.ipv6util.api.decoders;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertThrows;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.opendaylight.genius.ipv6util.api.Icmpv6Type;
-import org.opendaylight.infrautils.testutils.Asserts;
import org.opendaylight.openflowplugin.libraries.liblldp.BufferException;
import org.opendaylight.openflowplugin.libraries.liblldp.EtherTypes;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address;
"00 20", // Payload length
"3A" // Next header is ICMPv6
);
- Asserts.assertThrows(BufferException.class, () -> {
+ assertThrows(BufferException.class, () -> {
new Ipv6NaDecoder(invalidInputPayload).decode();
});
}
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
- <dependency>
- <groupId>org.opendaylight.infrautils</groupId>
- <artifactId>infrautils-testutils</artifactId>
- </dependency>
</dependencies>
<build>
<pluginManagement>
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.genius.ipv6util.nd;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.times;
import org.opendaylight.genius.mdsalutil.ActionInfo;
import org.opendaylight.genius.mdsalutil.MDSALUtil;
import org.opendaylight.genius.mdsalutil.actions.ActionGroup;
-import org.opendaylight.infrautils.testutils.Asserts;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
long invalidOfGroupId = -1;
// case: 1 - Invalid OF group ID
- Asserts.assertThrows(IllegalArgumentException.class, () -> {
+ assertThrows(IllegalArgumentException.class, () -> {
instance.transmitNeighborSolicitationToOfGroup(dpnId, srcMacAddress, srcIpv6Address, targetIpv6Address,
invalidOfGroupId);
});
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-spi</artifactId>
</dependency>
- <dependency>
- <groupId>org.opendaylight.infrautils</groupId>
- <artifactId>infrautils-testutils</artifactId>
- </dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.genius.mdsalutil.tests;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.opendaylight.genius.mdsalutil.NWUtil.getEtherTypeFromIpPrefix;
import static org.opendaylight.genius.mdsalutil.NWUtil.isIpAddressInRange;
import org.junit.Test;
import org.opendaylight.genius.mdsalutil.NwConstants;
-import org.opendaylight.infrautils.testutils.Asserts;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
}
private static void assertThrowsBadAddress(final String address) {
- final IllegalArgumentException thrown = Asserts.assertThrows(IllegalArgumentException.class, () -> {
+ final IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> {
getEtherTypeFromIpPrefix(address);
});
assertThat(thrown.getMessage()).contains(address.replaceAll("/.*", ""));
}
- private static IpAddress buildIpAddress(String ipAddress) {
+ private static IpAddress buildIpAddress(final String ipAddress) {
return IpAddressBuilder.getDefaultInstance(ipAddress);
}
- private static IpPrefix buildIpPrefix(String cidr) {
+ private static IpPrefix buildIpPrefix(final String cidr) {
return IpPrefixBuilder.getDefaultInstance(cidr);
}
}
package org.opendaylight.genius.datastoreutils.testutils.tests;
import static com.google.common.truth.Truth.assertThat;
-import static org.opendaylight.infrautils.testutils.Asserts.assertThrows;
+import static org.junit.Assert.assertThrows;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.Test;
package org.opendaylight.genius.infra.tests;
import static com.google.common.truth.Truth.assertThat;
+import static org.junit.Assert.assertThrows;
import org.junit.Test;
import org.opendaylight.genius.infra.Datastore;
-import org.opendaylight.infrautils.testutils.Asserts;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
public class DatastoreTest {
-
@Test
public void testDatastore() {
assertThat(Datastore.toType(Datastore.CONFIGURATION)).isEqualTo(LogicalDatastoreType.CONFIGURATION);
assertThat(Datastore.toType(Datastore.OPERATIONAL)).isEqualTo(LogicalDatastoreType.OPERATIONAL);
- Asserts.assertThrows(NullPointerException.class, () -> Datastore.toType(null));
+ assertThrows(NullPointerException.class, () -> Datastore.toType(null));
assertThat(Datastore.toClass(LogicalDatastoreType.CONFIGURATION)).isEqualTo(Datastore.CONFIGURATION);
assertThat(Datastore.toClass(LogicalDatastoreType.OPERATIONAL)).isEqualTo(Datastore.OPERATIONAL);
- Asserts.assertThrows(NullPointerException.class, () -> Datastore.toClass(null));
+ assertThrows(NullPointerException.class, () -> Datastore.toClass(null));
}
-
}
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.TOP_FOO_KEY;
import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.path;
import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.topLevelList;
import static org.opendaylight.genius.infra.Datastore.OPERATIONAL;
-import static org.opendaylight.infrautils.testutils.Asserts.assertThrows;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.TOP_FOO_KEY;
import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.path;
import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.topLevelList;
-import static org.opendaylight.infrautils.testutils.Asserts.assertThrows;
import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION;
import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.OPERATIONAL;