Polishing
This commit is contained in:
@@ -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.
|
||||
@@ -20,30 +20,24 @@ import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Test suite for {@link FastByteArrayOutputStream}
|
||||
* Test suite for {@link FastByteArrayOutputStream}.
|
||||
*
|
||||
* @author Craig Andrews
|
||||
*/
|
||||
public class FastByteArrayOutputStreamTests {
|
||||
|
||||
private static final int INITIAL_CAPACITY = 256;
|
||||
|
||||
private FastByteArrayOutputStream os;
|
||||
private final FastByteArrayOutputStream os = new FastByteArrayOutputStream(INITIAL_CAPACITY);;
|
||||
|
||||
private byte[] helloBytes;
|
||||
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
this.os = new FastByteArrayOutputStream(INITIAL_CAPACITY);
|
||||
this.helloBytes = "Hello World".getBytes("UTF-8");
|
||||
}
|
||||
private final byte[] helloBytes = "Hello World".getBytes(StandardCharsets.UTF_8);;
|
||||
|
||||
|
||||
@Test
|
||||
|
||||
@@ -45,6 +45,7 @@ public class ObjectUtilsTests {
|
||||
@Rule
|
||||
public final ExpectedException exception = ExpectedException.none();
|
||||
|
||||
|
||||
@Test
|
||||
public void isCheckedException() {
|
||||
assertTrue(ObjectUtils.isCheckedException(new Exception()));
|
||||
@@ -807,7 +808,8 @@ public class ObjectUtilsTests {
|
||||
assertThat(ObjectUtils.caseInsensitiveValueOf(Tropes.values(), "BAR"), is(Tropes.BAR));
|
||||
|
||||
exception.expect(IllegalArgumentException.class);
|
||||
exception.expectMessage(is("constant [bogus] does not exist in enum type org.springframework.util.ObjectUtilsTests$Tropes"));
|
||||
exception.expectMessage(
|
||||
is("Constant [bogus] does not exist in enum type org.springframework.util.ObjectUtilsTests$Tropes"));
|
||||
ObjectUtils.caseInsensitiveValueOf(Tropes.values(), "bogus");
|
||||
}
|
||||
|
||||
@@ -818,6 +820,6 @@ public class ObjectUtilsTests {
|
||||
}
|
||||
|
||||
|
||||
enum Tropes { FOO, BAR, baz }
|
||||
enum Tropes {FOO, BAR, baz}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user