Port kryo tests to assertj

This commit is contained in:
Janne Valkealahti
2020-11-28 14:32:01 +00:00
parent b4c2f1849a
commit d19b5d298a
3 changed files with 6 additions and 10 deletions

View File

@@ -304,8 +304,6 @@ project('spring-statemachine-kryo') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testCompile 'org.springframework:spring-test'
testCompile 'org.hamcrest:hamcrest-core'
testCompile 'org.hamcrest:hamcrest-library'
testCompile("org.junit.jupiter:junit-jupiter-api")
testCompile("org.junit.jupiter:junit-jupiter-engine")
testRuntime 'org.apache.logging.log4j:log4j-core'

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2018 the original author or authors.
* Copyright 2018-2020 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.
@@ -15,8 +15,7 @@
*/
package org.springframework.statemachine.kryo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.ArrayList;
import java.util.List;
@@ -50,6 +49,6 @@ public class KryoStateMachineSerialisationServiceTests {
byte[] bytes = service.serialiseStateMachineContext(root);
StateMachineContext<String, String> context = service.deserialiseStateMachineContext(bytes);
assertThat(context.getChilds().size(), is(2));
assertThat(context.getChilds()).hasSize(2);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2018-2019 the original author or authors.
* Copyright 2018-2020 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.
@@ -15,8 +15,7 @@
*/
package org.springframework.statemachine.kryo;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -98,7 +97,7 @@ public class StateMachineContextSerializerTests {
Input inputTo = new Input(new ByteArrayInputStream(outStreamFrom.toByteArray()));
StateMachineContext<String, String> rootTo = (StateMachineContext<String, String>) kryoTo.readClassAndObject(inputTo);
assertThat(rootFrom, equalTo(rootTo));
assertThat(rootFrom).isEqualTo(rootTo);
}
/**