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

@@ -1,3 +1,19 @@
/*
* 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.function.adapter.aws;
import java.util.Collections;

View File

@@ -188,7 +188,7 @@ class Foo {
Foo() {
}
public Foo(String value) {
Foo(String value) {
this.value = value;
}
@@ -217,7 +217,7 @@ class Bar {
Bar() {
}
public Bar(String value) {
Bar(String value) {
this.value = value;
}

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.adapter.azure;
import java.io.IOException;

View File

@@ -36,14 +36,13 @@ import org.springframework.context.annotation.Scope;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Kamesh Sampath
*/
@RunWith(SpringRunner.class)
@SpringBootTest()
@SpringBootTest
@EnableAutoConfiguration
@TestPropertySource(locations = "classpath:/application-test.properties")
public class OpenWhiskActionHandlerTest {
@@ -65,9 +64,9 @@ public class OpenWhiskActionHandlerTest {
actionRequest.setActionName("test_action");
actionRequest.setValue(eventData);
Object result = this.actionHandler.run(actionRequest);
assertNotNull(result);
assertEquals("{\"result\":{\"name\":\"Spring\",\"message\":\"Hello, Spring\"}}",
result);
assertThat(result).isNotNull();
assertThat(result).isEqualTo(
"{\"result\":{\"name\":\"Spring\",\"message\":\"Hello, Spring\"}}");
}
@Test
@@ -78,8 +77,8 @@ public class OpenWhiskActionHandlerTest {
OpenWhiskActionRequest actionRequest = new OpenWhiskActionRequest();
actionRequest.setActionName("test_action");
Object result = this.actionHandler.run(actionRequest);
assertNotNull(result);
assertEquals("{\"result\":\"No input provided\"}", result);
assertThat(result).isNotNull();
assertThat(result).isEqualTo("{\"result\":\"No input provided\"}");
}
@Configuration