Skip to content
Permalink
Browse files

Upgrade Kotlin to 1.2.40; add assertk/j

  • Loading branch information...
garyrussell authored and artembilan committed Apr 27, 2018
1 parent 80848fd commit f678078e293fd0d23278febfcf315bd2e663baad
@@ -1,5 +1,5 @@
buildscript {
ext.kotlinVersion = '1.2.31'
ext.kotlinVersion = '1.2.40'
repositories {
maven { url 'https://repo.spring.io/plugins-release' }
}
@@ -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'
@@ -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")
}

@@ -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"
@@ -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.
@@ -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;
@@ -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
@@ -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
@@ -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")
@@ -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
@@ -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

0 comments on commit f678078

Please sign in to comment.
You can’t perform that action at this time.