Skip to content

Commit

Permalink
Feat: updating junit from version 4.x to 5.x (#56)
Browse files Browse the repository at this point in the history
- updated version of junit 4.x -> 5.x
- updated version of mockito
- updated tests
- result codes tests has been split on a several groups
- marking commented out tests as @disabled
- fixed misprints

Signed-off-by: Mikhail Laptev <mikhail.laptev@gmail.com>
  • Loading branch information
MikeLaptev authored Apr 24, 2024
1 parent c53f742 commit 1986bae
Show file tree
Hide file tree
Showing 85 changed files with 1,922 additions and 1,723 deletions.
17 changes: 15 additions & 2 deletions bmq-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ limitations under the License. -->
</dependency>

<!-- Test dependencies-->

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -96,6 +97,18 @@ limitations under the License. -->
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bmq-sdk/src/test/bin/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# USAGE
# =====
# docker-build.sh image_name
# BMQ_DOCKER_IMAGE=image_name docker_build.sh
# BMQ_DOCKER_IMAGE=image_name docker-build.sh

image=""

Expand Down
12 changes: 6 additions & 6 deletions bmq-sdk/src/test/java/com/bloomberg/bmq/MessageGUIDTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
*/
package com.bloomberg.bmq;

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

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

public class MessageGUIDTest {
class MessageGUIDTest {

@Test
public void testGUID() {
void testGUID() {
// Test some valid & invalid hex reps
final String INVALID_HEX_REP = "abcdefghijklmnopqrstuvwxyz012345";
final String VALID_HEX_REP = "ABCDEF0123456789ABCDEF0123456789";
Expand Down
12 changes: 6 additions & 6 deletions bmq-sdk/src/test/java/com/bloomberg/bmq/QueueFlagsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
*/
package com.bloomberg.bmq;

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

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

public class QueueFlagsTest {
class QueueFlagsTest {

@Test
public void testFlags() {
void testFlags() {
long l = 0L;

assertFalse(QueueFlags.isReader(l));
Expand Down
16 changes: 8 additions & 8 deletions bmq-sdk/src/test/java/com/bloomberg/bmq/QueueOptionsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
*/
package com.bloomberg.bmq;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.lang.invoke.MethodHandles;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class QueueOptionsTest {
class QueueOptionsTest {
static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

@Test
public void breathingTest() {
void breathingTest() {
// Create default options
QueueOptions obj = QueueOptions.createDefault();

Expand Down Expand Up @@ -92,7 +92,7 @@ public void breathingTest() {
}

@Test
public void mergeTest() {
void mergeTest() {
QueueOptions baseOptions =
QueueOptions.builder()
.setConsumerPriority(2)
Expand Down
Loading

0 comments on commit 1986bae

Please sign in to comment.