Added checkstyle for tests

This commit is contained in:
Marcin Grzejszczak
2019-02-03 15:34:10 +01:00
parent e4b08a083c
commit c6ddfe1af4
61 changed files with 273 additions and 228 deletions

View File

@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.function.context;
import java.util.function.Function;

View File

@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.function.context;
import java.lang.reflect.Type;

View File

@@ -24,10 +24,7 @@ import org.springframework.cloud.function.context.FunctionRegistration;
import org.springframework.cloud.function.context.FunctionType;
import org.springframework.cloud.function.core.FluxFunction;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Oleg Zhurakousky
@@ -43,7 +40,7 @@ public class InMemoryFunctionCatalogTests {
InMemoryFunctionCatalog catalog = new InMemoryFunctionCatalog();
catalog.register(registration);
FunctionRegistration<?> registration2 = catalog.getRegistration(function);
assertSame(registration, registration2);
assertThat(registration2).isSameAs(registration);
}
@Test
@@ -55,11 +52,11 @@ public class InMemoryFunctionCatalogTests {
catalog.register(registration);
Object lookedUpFunction = catalog.lookup("hello");
assertNull(lookedUpFunction);
assertThat(lookedUpFunction).isNull();
lookedUpFunction = catalog.lookup("foo");
assertNotNull(lookedUpFunction);
assertTrue(lookedUpFunction instanceof FluxFunction);
assertThat(lookedUpFunction).isNotNull();
assertThat(lookedUpFunction instanceof FluxFunction).isTrue();
}
private static class TestFunction implements Function<Integer, String> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019-2018 the original author or authors.
* Copyright 2012-2019 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019-2018 the original author or authors.
* Copyright 2012-2019 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.

View File

@@ -40,7 +40,6 @@ import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.util.ClassUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertNull;
/**
* @author Dave Syer
@@ -132,7 +131,7 @@ public class ContextFunctionPostProcessorTests {
System.out::println, "consumer"));
Supplier<Mono<Void>> supplier = (Supplier<Mono<Void>>) this.processor
.lookupSupplier("supplier|consumer");
assertNull(supplier.get().block());
assertThat(supplier.get().block()).isNull();
}
@Test

View File

@@ -36,7 +36,9 @@ import static org.assertj.core.api.Assertions.assertThat;
*
*/
@RunWith(SpringRunner.class)
// @checkstyle:off
@FunctionalSpringBootTest(classes = Object.class, properties = "spring.main.sources=org.springframework.cloud.function.context.string.FunctionalStringSourceTests.TestConfiguration")
// @checkstyle:on
public class FunctionalStringSourceTests {
@Autowired

View File

@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.function.inject;
import java.util.function.Function;

View File

@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.function.util;
import java.util.Arrays;