Skip to content
Permalink
Browse files
Various junit fixes
  • Loading branch information
coheigea committed Jun 18, 2019
1 parent 2a10bd4 commit ed695ce64137487a89e7a8190c54eadc0c456987
Show file tree
Hide file tree
Showing 34 changed files with 90 additions and 185 deletions.
@@ -38,12 +38,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
@@ -38,12 +38,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>api-i18n</artifactId>
@@ -54,12 +54,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>api-ldap-schema-data</artifactId>
@@ -99,7 +99,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.10.19</version>
<version>2.28.1</version>
<scope>test</scope>
</dependency>

@@ -20,7 +20,7 @@
package org.apache.directory.ldap.client.api;


import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.io.IOException;
import java.util.Arrays;
@@ -21,6 +21,10 @@
package org.apache.directory.ldap.client.api;


import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.IOException;
import java.util.HashSet;
import java.util.List;
@@ -37,12 +41,8 @@
import org.apache.directory.api.ldap.model.schema.SchemaManager;
import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
import org.apache.directory.api.util.Strings;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertNotSame;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;


/**
@@ -57,7 +57,7 @@
private LdifReader ldifReader;


@Before
@BeforeEach
public void setup()
{
schemaManager = null;
@@ -20,10 +20,10 @@
package org.apache.directory.ldap.client.api;


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

import java.io.FileInputStream;
import java.io.IOException;
@@ -70,7 +70,7 @@
import org.apache.directory.api.ldap.model.schema.registries.Schema;
import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
import org.apache.directory.api.util.exception.Exceptions;
import org.junit.Test;
import org.junit.jupiter.api.Test;


/**
@@ -140,7 +140,7 @@ public void testLoadQuirkySchema() throws Exception
fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
}

assertTrue ( "Surprisingly no errors after load", schemaManager.getErrors().size() > 0 );
assertTrue ( schemaManager.getErrors().size() > 0, "Surprisingly no errors after load" );

assertTrue( schemaManager.getRegistries().getAttributeTypeRegistry().contains( "cn" ) );
ObjectClass person = schemaManager.getRegistries().getObjectClassRegistry().lookup( "person" );
@@ -20,8 +20,8 @@
package org.apache.directory.ldap.client.api;


import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
@@ -38,7 +38,7 @@
import org.apache.directory.api.ldap.model.message.ExtendedRequest;
import org.apache.directory.api.ldap.model.message.ExtendedResponse;
import org.apache.directory.api.ldap.model.name.Dn;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.mockito.exceptions.misusing.NotAMockException;
import org.mockito.internal.util.MockUtil;
import org.mockito.verification.VerificationMode;
@@ -48,8 +48,6 @@
{
private static final String ADMIN_CREDENTIALS = "secret";
private static final String ADMIN_DN = "uid=admin, ou=system";
private static final MockUtil MOCK_UTIL = new MockUtil();


@Test
public void testPoolWithBind()
@@ -266,7 +264,7 @@ private static final void verifyAdminBind( LdapConnection connection, Verificati

private static final LdapConnection verify( LdapConnection connection, VerificationMode mode )
{
if ( MOCK_UTIL.isMock( connection ) )
if ( MockUtil.isMock( connection ) )
{
return org.mockito.Mockito.verify( connection, mode );
}
@@ -20,11 +20,9 @@

package org.apache.directory.ldap.client.api.search;

import static org.junit.jupiter.api.Assertions.assertEquals;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import org.junit.jupiter.api.Test;

/**
*
@@ -19,11 +19,9 @@
*/
package org.apache.directory.ldap.client.api.search;

import static org.junit.jupiter.api.Assertions.assertEquals;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import org.junit.jupiter.api.Test;

/**
*
@@ -29,10 +29,10 @@
import static org.apache.directory.ldap.client.api.search.FilterBuilder.or;
import static org.apache.directory.ldap.client.api.search.FilterBuilder.startsWith;
import static org.apache.directory.ldap.client.api.search.FilterBuilder.substring;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;

import org.junit.Test;
import org.junit.jupiter.api.Test;


/**
@@ -21,10 +21,10 @@
package org.apache.directory.ldap.client.api.search;


import static org.junit.Assert.assertEquals;
import static org.apache.directory.ldap.client.api.search.FilterBuilder.extensible;
import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.Test;
import org.junit.jupiter.api.Test;


/**
@@ -20,11 +20,11 @@
package org.apache.directory.ldap.client.api.search;


import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.Arrays;

import org.junit.Test;
import org.junit.jupiter.api.Test;


/**
@@ -19,11 +19,9 @@
*/
package org.apache.directory.ldap.client.api.search;

import static org.junit.jupiter.api.Assertions.assertEquals;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import org.junit.jupiter.api.Test;

/**
*
@@ -37,12 +37,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>api-util</artifactId>
@@ -20,12 +20,12 @@
package org.apache.directory.api.ldap.codec.bind;


import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assertions.assertThrows;

import java.nio.ByteBuffer;
@@ -48,12 +48,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>api-ldap-net-mina</artifactId>
@@ -37,12 +37,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>api-util</artifactId>
@@ -40,12 +40,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>api-ldap-model</artifactId>
@@ -43,12 +43,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>api-ldap-codec-core</artifactId>
@@ -37,12 +37,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>api-util</artifactId>
@@ -37,12 +37,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>api-util</artifactId>
@@ -37,12 +37,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>api-i18n</artifactId>
@@ -38,11 +38,11 @@
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>api-util</artifactId>

0 comments on commit ed695ce

Please sign in to comment.