Skip to content

Commit

Permalink
Upgrade Kotlin to 1.2.40; add assertk/j
Browse files Browse the repository at this point in the history
  • Loading branch information
garyrussell authored and artembilan committed Apr 27, 2018
1 parent 80848fd commit f678078
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
9 changes: 7 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlinVersion = '1.2.31'
ext.kotlinVersion = '1.2.40'
repositories {
maven { url 'https://repo.spring.io/plugins-release' }
}
Expand Down Expand Up @@ -69,6 +69,8 @@ subprojects { subproject ->
targetCompatibility=1.8

ext {
assertjVersion = '3.9.1'
assertkVersion = '0.10'
hamcrestVersion = '1.3'
jackson2Version = '2.9.5'
junit4Version = '4.12'
Expand Down Expand Up @@ -258,7 +260,9 @@ project('spring-rabbit') {

testCompile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
testRuntime "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"

testCompile("com.willowtreeapps.assertk:assertk:$assertkVersion") {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-reflect'
}
testCompile project(":spring-rabbit-junit")
}

Expand All @@ -283,6 +287,7 @@ project('spring-rabbit-junit') {
}
compile "org.springframework:spring-web:$springVersion"
compile ("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion", optional)
compile "org.assertj:assertj-core:$assertjVersion"
compileOnly 'org.apiguardian:apiguardian-api:1.0.0'

testRuntime "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@

package org.springframework.amqp.rabbit.core;

import static org.junit.Assert.assertEquals;
import static org.assertj.core.api.Assertions.assertThat;

import org.apache.logging.log4j.Level;
import org.junit.After;
Expand Down Expand Up @@ -102,7 +102,7 @@ public void testSendAndReceive() throws Exception {
Thread.sleep(10L);
result = (String) template.receiveAndConvert(ROUTE);
}
assertEquals("message", result);
assertThat(result).isEqualTo("message");
}

@Test
Expand All @@ -111,7 +111,7 @@ public void testSendAndReceiveTransacted() throws Exception {
template.setChannelTransacted(true);
template.convertAndSend(ROUTE, "message");
String result = (String) template.receiveAndConvert(ROUTE);
assertEquals("message", result);
assertThat(result).isEqualTo("message");
}

@Test
Expand All @@ -124,7 +124,7 @@ public void testSendAndReceiveExternalTransacted() throws Exception {
});
template.convertAndSend(ROUTE, "message");
String result = (String) template.receiveAndConvert(ROUTE);
assertEquals("message", result);
assertThat(result).isEqualTo("message");
}

@SuppressWarnings("serial")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

package org.springframework.amqp.rabbit.annotation

import org.junit.jupiter.api.Assertions.assertTrue
import assertk.assert
import assertk.assertions.isTrue
import org.junit.jupiter.api.Test
import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory
Expand Down Expand Up @@ -51,7 +52,7 @@ class EnableRabbitKotlinTests {
fun `send and wait for consume` () {
val template = RabbitTemplate(this.config.cf())
template.convertAndSend("kotlinQueue", "test")
assertTrue(this.config.latch.await(10, TimeUnit.SECONDS))
assert(this.config.latch.await(10, TimeUnit.SECONDS)).isTrue();
}

@Configuration
Expand Down

0 comments on commit f678078

Please sign in to comment.