Browse Source

Polishing

pull/1243/head
Juergen Hoeller 8 years ago
parent
commit
1f4c6de287
  1. 1
      spring-context/src/main/java/org/springframework/jmx/support/ConnectorServerFactoryBean.java
  2. 3
      spring-jdbc/src/test/java/org/springframework/jdbc/core/AbstractRowMapperTests.java
  3. 11
      spring-web/src/test/java/org/springframework/http/codec/ServerSentEventHttpMessageWriterTests.java

1
spring-context/src/main/java/org/springframework/jmx/support/ConnectorServerFactoryBean.java

@ -49,7 +49,6 @@ import org.springframework.util.CollectionUtils; @@ -49,7 +49,6 @@ import org.springframework.util.CollectionUtils;
* @author Rob Harrop
* @author Juergen Hoeller
* @since 1.2
* @see FactoryBean
* @see JMXConnectorServer
* @see MBeanServer
*/

3
spring-jdbc/src/test/java/org/springframework/jdbc/core/AbstractRowMapperTests.java

@ -90,6 +90,7 @@ public abstract class AbstractRowMapperTests { @@ -90,6 +90,7 @@ public abstract class AbstractRowMapperTests {
this(MockType.ONE);
}
@SuppressWarnings("unchecked")
public Mock(MockType type) throws Exception {
connection = mock(Connection.class);
statement = mock(Statement.class);
@ -107,7 +108,7 @@ public abstract class AbstractRowMapperTests { @@ -107,7 +108,7 @@ public abstract class AbstractRowMapperTests {
given(resultSet.getObject(anyInt(), any(Class.class))).willThrow(new SQLFeatureNotSupportedException());
given(resultSet.getDate(3)).willReturn(new java.sql.Date(1221222L));
given(resultSet.getBigDecimal(4)).willReturn(new BigDecimal("1234.56"));
given(resultSet.wasNull()).willReturn(type == MockType.TWO ? true : false);
given(resultSet.wasNull()).willReturn(type == MockType.TWO);
given(resultSetMetaData.getColumnCount()).willReturn(4);
given(resultSetMetaData.getColumnLabel(1)).willReturn(

11
spring-web/src/test/java/org/springframework/http/codec/ServerSentEventHttpMessageWriterTests.java

@ -33,8 +33,7 @@ import org.springframework.http.MediaType; @@ -33,8 +33,7 @@ import org.springframework.http.MediaType;
import org.springframework.http.codec.json.Jackson2JsonEncoder;
import org.springframework.mock.http.server.reactive.test.MockServerHttpResponse;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
/**
* @author Sebastien Deleuze
@ -64,9 +63,10 @@ public class ServerSentEventHttpMessageWriterTests extends AbstractDataBufferAll @@ -64,9 +63,10 @@ public class ServerSentEventHttpMessageWriterTests extends AbstractDataBufferAll
@Test
public void encodeServerSentEvent() {
ServerSentEvent<String>
event = ServerSentEvent.<String>builder().data("bar").id("c42").event("foo").comment("bla\nbla bla\nbla bla bla")
ServerSentEvent<String> event = ServerSentEvent.<String>builder().
data("bar").id("c42").event("foo").comment("bla\nbla bla\nbla bla bla")
.retry(Duration.ofMillis(123L)).build();
Mono<ServerSentEvent<String>> source = Mono.just(event);
MockServerHttpResponse outputMessage = new MockServerHttpResponse();
messageWriter.write(source, ResolvableType.forClass(ServerSentEvent.class),
@ -126,9 +126,10 @@ public class ServerSentEventHttpMessageWriterTests extends AbstractDataBufferAll @@ -126,9 +126,10 @@ public class ServerSentEventHttpMessageWriterTests extends AbstractDataBufferAll
.verify();
}
private Consumer<Publisher<DataBuffer>> sseConsumer(String... expected) {
return publisher -> {
StepVerifier.Step builder = StepVerifier.create(publisher);
StepVerifier.Step<DataBuffer> builder = StepVerifier.create(publisher);
for (String value : expected) {
builder = builder.consumeNextWith(stringConsumer(value));
}

Loading…
Cancel
Save