Polish
This commit is contained in:
@@ -24,13 +24,13 @@ import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import static junit.framework.TestCase.assertNotNull;
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
import static org.mockito.Matchers.isA;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* Tests for {@link InitializrService}
|
||||
@@ -104,7 +104,7 @@ public class InitializrServiceTests extends AbstractHttpClientMockTests {
|
||||
mockSuccessfulMetadataGet(false);
|
||||
CloseableHttpResponse response = mock(CloseableHttpResponse.class);
|
||||
mockStatus(response, 500);
|
||||
when(this.http.execute(isA(HttpGet.class))).thenReturn(response);
|
||||
given(this.http.execute(isA(HttpGet.class))).willReturn(response);
|
||||
ProjectGenerationRequest request = new ProjectGenerationRequest();
|
||||
this.thrown.expect(ReportableException.class);
|
||||
this.thrown.expectMessage("No content received from server");
|
||||
@@ -126,7 +126,7 @@ public class InitializrServiceTests extends AbstractHttpClientMockTests {
|
||||
CloseableHttpResponse response = mock(CloseableHttpResponse.class);
|
||||
mockHttpEntity(response, "Foo-Bar-Not-JSON".getBytes(), "application/json");
|
||||
mockStatus(response, 200);
|
||||
when(this.http.execute(isA(HttpGet.class))).thenReturn(response);
|
||||
given(this.http.execute(isA(HttpGet.class))).willReturn(response);
|
||||
ProjectGenerationRequest request = new ProjectGenerationRequest();
|
||||
this.thrown.expect(ReportableException.class);
|
||||
this.thrown.expectMessage("Invalid content received from server");
|
||||
@@ -137,7 +137,7 @@ public class InitializrServiceTests extends AbstractHttpClientMockTests {
|
||||
public void loadMetadataNoContent() throws IOException {
|
||||
CloseableHttpResponse response = mock(CloseableHttpResponse.class);
|
||||
mockStatus(response, 500);
|
||||
when(this.http.execute(isA(HttpGet.class))).thenReturn(response);
|
||||
given(this.http.execute(isA(HttpGet.class))).willReturn(response);
|
||||
ProjectGenerationRequest request = new ProjectGenerationRequest();
|
||||
this.thrown.expect(ReportableException.class);
|
||||
this.thrown.expectMessage("No content received from server");
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.io.IOException;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.core.StringContains.containsString;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,10 @@ import java.util.Map.Entry;
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
public class SystemProperties {
|
||||
public final class SystemProperties {
|
||||
|
||||
private SystemProperties() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the given {@code action} with the given system properties set. System
|
||||
|
||||
Reference in New Issue
Block a user