merge with develop

This commit is contained in:
Eduard Heimbuch
2020-05-20 12:13:47 +02:00
23 changed files with 442 additions and 89 deletions

View File

@@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Detect renamed files in git and hg diffs ([#1157](https://github.com/scm-manager/scm-manager/pull/1157))
### Fixed
- Resolved conflicting dependencies for scm-webapp ([#1159](https://github.com/scm-manager/scm-manager/pull/1159))
## [2.0.0-rc8] - 2020-05-08
### Added
- Add iconStyle + onClick option and story shot for icon component ([#1100](https://github.com/scm-manager/scm-manager/pull/1100))

1
Jenkinsfile vendored
View File

@@ -206,6 +206,7 @@ Maven setupMavenBuild() {
def logConf = "scm-webapp/src/main/resources/logback.ci.xml"
mvn.additionalArgs += " -Dlogback.configurationFile=${logConf}"
mvn.additionalArgs += " -Dscm-it.logbackConfiguration=${logConf}"
mvn.additionalArgs += " -Dsonar.coverage.exclusions=**/*.test.ts,**/*.test.tsx,**/*.stories.tsx"
if (isMainBranch() || isReleaseBranch()) {
// Release starts javadoc, which takes very long, so do only for certain branches

68
pom.xml
View File

@@ -241,6 +241,16 @@
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-core</artifactId>
<version>${resteasy.version}</version>
<exclusions>
<exclusion>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.spec.javax.xml.bind</groupId>
<artifactId>jboss-jaxb-api_2.3_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
@@ -253,6 +263,12 @@
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
<version>${resteasy.version}</version>
<exclusions>
<exclusion>
<groupId>org.jboss.spec.javax.xml.bind</groupId>
<artifactId>jboss-jaxb-api_2.3_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
@@ -267,6 +283,30 @@
<version>${resteasy.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client-api</artifactId>
<version>${resteasy.version}</version>
<exclusions>
<exclusion>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>${resteasy.version}</version>
<exclusions>
<exclusion>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-guice</artifactId>
@@ -277,6 +317,12 @@
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-servlet-initializer</artifactId>
<version>${resteasy.version}</version>
<exclusions>
<exclusion>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--
@@ -418,6 +464,12 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.5</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- logging -->
@@ -437,8 +489,8 @@
<!-- xml -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>${jaxb.version}</version>
</dependency>
@@ -448,12 +500,6 @@
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<!-- utils -->
<dependency>
@@ -901,20 +947,20 @@
<properties>
<!-- test libraries -->
<mockito.version>2.28.2</mockito.version>
<hamcrest.version>1.3</hamcrest.version>
<hamcrest.version>2.1</hamcrest.version>
<junit.version>5.6.2</junit.version>
<!-- logging libraries -->
<slf4j.version>1.7.30</slf4j.version>
<logback.version>1.2.3</logback.version>
<servlet.version>3.0.1</servlet.version>
<servlet.version>3.1.0</servlet.version>
<jaxrs.version>2.1.1</jaxrs.version>
<resteasy.version>4.5.3.Final</resteasy.version>
<jersey-client.version>1.19.4</jersey-client.version>
<jackson.version>2.11.0</jackson.version>
<guice.version>4.2.3</guice.version>
<jaxb.version>2.3.1</jaxb.version>
<jaxb.version>2.3.2</jaxb.version>
<hibernate-validator.version>6.1.4.Final</hibernate-validator.version>
<!-- event bus -->

View File

@@ -173,8 +173,8 @@
<!-- xml -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
@@ -182,11 +182,6 @@
<artifactId>jaxb-runtime</artifactId>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</dependency>
<!-- validation -->
<dependency>

View File

@@ -39,6 +39,7 @@ import java.io.IOException;
import java.util.zip.GZIPOutputStream;
import javax.servlet.ServletOutputStream;
import javax.servlet.WriteListener;
import javax.servlet.http.HttpServletResponse;
/**
@@ -245,6 +246,20 @@ public class GZipResponseStream extends ServletOutputStream
return closed;
}
@Override
public boolean isReady() {
return true;
}
@Override
public void setWriteListener(WriteListener writeListener) {
try {
writeListener.onWritePossible();
} catch (IOException e) {
logger.debug("could not call writeListener.onWritePossible()", e);
}
}
//~--- fields ---------------------------------------------------------------
/** Field description */

View File

@@ -36,6 +36,7 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
@@ -197,6 +198,25 @@ public class BufferedHttpServletRequest extends HttpServletRequestWrapper
return bais.read(buf, off, len);
}
@Override
public boolean isFinished() {
return bais.available() == 0;
}
@Override
public boolean isReady() {
return bais.available() > 0;
}
@Override
public void setReadListener(ReadListener readListener) {
try {
readListener.onDataAvailable();
} catch (IOException e) {
logger.debug("could not call readListener.onDataAvailable()", e);
}
}
//~--- fields -------------------------------------------------------------
/** Field description */

View File

@@ -26,6 +26,9 @@ package sonia.scm.web.filter;
//~--- JDK imports ------------------------------------------------------------
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
@@ -37,6 +40,7 @@ import java.util.Map;
import java.util.Set;
import javax.servlet.ServletOutputStream;
import javax.servlet.WriteListener;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
@@ -48,6 +52,8 @@ import javax.servlet.http.HttpServletResponseWrapper;
public class BufferedHttpServletResponse extends HttpServletResponseWrapper
{
private static final Logger LOG = LoggerFactory.getLogger(BufferedHttpServletResponse.class);
/**
* Constructs ...
*
@@ -445,6 +451,20 @@ public class BufferedHttpServletResponse extends HttpServletResponseWrapper
baos.write(param);
}
@Override
public boolean isReady() {
return true;
}
@Override
public void setWriteListener(WriteListener writeListener) {
try {
writeListener.onWritePossible();
} catch (IOException e) {
LOG.debug("could not call writeListener.onWritePossible()", e);
}
}
//~--- fields -------------------------------------------------------------
/** Field description */

View File

@@ -102,7 +102,7 @@
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>3.1.0</version>
<version>4.3.0</version>
<scope>test</scope>
</dependency>

View File

@@ -66,7 +66,7 @@ public class RoleITCase {
given(VndMediaType.REPOSITORY_ROLE)
.when()
.content("{" +
.body("{" +
"\"name\": \"" + ROLE_NAME + "\"," +
"\"verbs\": [\"read\",\"permissionRead\"]" +
"}")
@@ -84,7 +84,7 @@ public class RoleITCase {
given(VndMediaType.REPOSITORY_PERMISSION)
.when()
.content("{\n" +
.body("{\n" +
"\t\"role\": \"" + ROLE_NAME + "\",\n" +
"\t\"name\": \"" + USER + "\",\n" +
"\t\"groupPermission\": false\n" +

View File

@@ -86,7 +86,7 @@ public class TestData {
String admin = isAdmin ? "true" : "false";
given(VndMediaType.USER)
.when()
.content(new StringBuilder()
.body(new StringBuilder()
.append(" {\n")
.append(" \"active\": true,\n")
.append(" \"admin\": ").append(admin).append(",\n")
@@ -124,7 +124,7 @@ public class TestData {
LOG.info("create group with group name: {} and description {}", groupName, desc);
given(VndMediaType.GROUP)
.when()
.content(getGroupJson(groupName,desc))
.body(getGroupJson(groupName,desc))
.post(getGroupsUrl())
.then()
.statusCode(HttpStatus.SC_CREATED)
@@ -136,7 +136,7 @@ public class TestData {
LOG.info("create permission with name {} and verbs {} using the endpoint: {}", username, verbs, defaultPermissionUrl);
given(VndMediaType.REPOSITORY_PERMISSION)
.when()
.content("{\n" +
.body("{\n" +
"\t\"verbs\": " + verbs.stream().collect(Collectors.joining("\",\"", "[\"", "\"]")) + ",\n" +
"\t\"name\": \"" + username + "\",\n" +
"\t\"groupPermission\": false\n" +

View File

@@ -33,6 +33,7 @@ import sonia.scm.repository.spi.ScmProviderHttpServlet;
import sonia.scm.util.HttpUtil;
import javax.servlet.ServletOutputStream;
import javax.servlet.WriteListener;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
@@ -150,6 +151,16 @@ public class GitPermissionFilterTest {
public String toString() {
return baos.toString();
}
@Override
public boolean isReady() {
return true;
}
@Override
public void setWriteListener(WriteListener writeListener) {
}
}
}

View File

@@ -26,6 +26,7 @@ package sonia.scm.web;
import com.google.common.base.Preconditions;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -76,4 +77,19 @@ public class HgServletInputStream extends ServletInputStream {
public void close() throws IOException {
original.close();
}
@Override
public boolean isFinished() {
return original.isFinished();
}
@Override
public boolean isReady() {
return original.isReady();
}
@Override
public void setReadListener(ReadListener readListener) {
original.setReadListener(readListener);
}
}

View File

@@ -28,6 +28,7 @@ import com.google.common.base.Charsets;
import com.google.common.io.ByteStreams;
import org.junit.Test;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -69,6 +70,20 @@ public class HgServletInputStreamTest {
public int read() {
return input.read();
}
@Override
public boolean isFinished() {
return false;
}
@Override
public boolean isReady() {
return false;
}
@Override
public void setReadListener(ReadListener readListener) {
}
}
}

View File

@@ -31,6 +31,7 @@ import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import java.io.ByteArrayInputStream;
@@ -181,6 +182,19 @@ public class WireProtocolTest {
return input.read();
}
@Override
public boolean isFinished() {
return false;
}
@Override
public boolean isReady() {
return false;
}
@Override
public void setReadListener(ReadListener readListener) {
}
}
}

View File

@@ -48,13 +48,6 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

View File

@@ -146,6 +146,12 @@
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
</dependency>
<!-- rest api -->
<dependency>
@@ -197,21 +203,15 @@
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>3.0.1-b11</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.0</version>
<version>${jaxb.version}</version>
</dependency>
<!-- injection -->
@@ -438,13 +438,6 @@
<!-- global excludes -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
@@ -654,6 +647,20 @@
</configuration>
</plugin>
<plugin>
<groupId>org.basepom.maven</groupId>
<artifactId>duplicate-finder-maven-plugin</artifactId>
<version>1.3.0</version>
<configuration>
<printEqualFiles>false</printEqualFiles>
<failBuildInCaseOfDifferentContentConflict>false</failBuildInCaseOfDifferentContentConflict>
<failBuildInCaseOfEqualContentConflict>false</failBuildInCaseOfEqualContentConflict>
<failBuildInCaseOfConflict>false</failBuildInCaseOfConflict>
<checkCompileClasspath>true</checkCompileClasspath>
<checkRuntimeClasspath>true</checkRuntimeClasspath>
<checkTestClasspath>false</checkTestClasspath>
</configuration>
</plugin>
</plugins>
<finalName>scm-webapp</finalName>

View File

@@ -0,0 +1,59 @@
/*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package sonia.scm.api;
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import sonia.scm.api.v2.resources.ErrorDto;
import sonia.scm.web.VndMediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import java.util.Collections;
@Provider
public class InvalidFormatExceptionMapper implements ExceptionMapper<InvalidFormatException> {
private static final Logger LOG = LoggerFactory.getLogger(InvalidFormatExceptionMapper.class);
private static final String ERROR_CODE = "2qRyyaVcJ1";
@Override
public Response toResponse(InvalidFormatException exception) {
LOG.trace("got invalid format in json: {}", exception.getMessage());
ErrorDto errorDto = new ErrorDto();
errorDto.setMessage("invalid format in json content: " + exception.getMessage());
errorDto.setContext(Collections.emptyList());
errorDto.setErrorCode(ERROR_CODE);
errorDto.setTransactionId(MDC.get("transaction_id"));
return Response.status(Response.Status.BAD_REQUEST)
.entity(errorDto)
.type(VndMediaType.ERROR_TYPE)
.build();
}
}

View File

@@ -215,6 +215,10 @@
"8nRuFzjss1": {
"displayName": "Fehler beim Löschen falscher Downloads",
"description": "Ein fehlerhaft heruntergeladenes Plugin konnte nicht gelöscht werden. Bitte prüfen Sie die Server Logs und löschen die Datei manuell."
},
"2qRyyaVcJ1": {
"displayName": "Ungültig formatiertes Element",
"description": "Die Eingabe beinhaltete unfültige Formate. Bitte prüfen Sie die Server Logs für genauere Informationen."
}
},
"namespaceStrategies": {

View File

@@ -215,6 +215,10 @@
"8nRuFzjss1": {
"displayName": "Error while cleaning up failed plugin",
"description": "A failed plugin download could not be removed correctly. Please check the server log and remove the plugin manually."
},
"2qRyyaVcJ1": {
"displayName": "Invalid format in element",
"description": "The input had some invalid formats. Please check the server log for further information."
}
},
"namespaceStrategies": {

View File

@@ -33,16 +33,23 @@ import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletOutputStream;
import javax.servlet.WriteListener;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.util.*;
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.verify;
@@ -173,7 +180,7 @@ public class ProxyPushStateDispatcherTest {
private class DevServletInputStream extends ServletInputStream {
private InputStream inputStream;
private ByteArrayInputStream inputStream;
private DevServletInputStream(String content) {
inputStream = new ByteArrayInputStream(content.getBytes(Charsets.UTF_8));
@@ -183,6 +190,20 @@ public class ProxyPushStateDispatcherTest {
public int read() throws IOException {
return inputStream.read();
}
@Override
public boolean isReady() {
return inputStream.available() > 0;
}
@Override
public boolean isFinished() {
return inputStream.available() == 0;
}
@Override
public void setReadListener(ReadListener readListener) {
}
}
private class DevServletOutputStream extends ServletOutputStream {
@@ -193,6 +214,15 @@ public class ProxyPushStateDispatcherTest {
public void write(int b) {
stream.write(b);
}
@Override
public boolean isReady() {
return true;
}
@Override
public void setWriteListener(WriteListener writeListener) {
}
}
}

View File

@@ -37,6 +37,7 @@ import sonia.scm.plugin.PluginLoader;
import sonia.scm.plugin.UberWebResourceLoader;
import javax.servlet.ServletOutputStream;
import javax.servlet.WriteListener;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
@@ -152,6 +153,15 @@ public class WebResourceServletTest {
public void write(int b) {
buffer.write(b);
}
@Override
public boolean isReady() {
return true;
}
@Override
public void setWriteListener(WriteListener writeListener) {
}
}
}

View File

@@ -0,0 +1,74 @@
/*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package sonia.scm.api;
import org.jboss.resteasy.mock.MockDispatcherFactory;
import org.jboss.resteasy.mock.MockHttpRequest;
import org.jboss.resteasy.mock.MockHttpResponse;
import org.jboss.resteasy.spi.Dispatcher;
import org.junit.jupiter.api.Test;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import static org.assertj.core.api.Assertions.assertThat;
class InvalidFormatExceptionMapperTest {
@Test
void shouldMapInvalidFormatExceptionDueToInvalidEnum() throws URISyntaxException, UnsupportedEncodingException {
Dispatcher dispatcher = MockDispatcherFactory.createDispatcher();
dispatcher.getRegistry().addSingletonResource(new SimpleResource());
dispatcher.getProviderFactory().registerProvider(InvalidFormatExceptionMapper.class);
MockHttpRequest request = MockHttpRequest
.post("/")
.contentType("application/json")
.content("{\"e\": \"NONE\"}".getBytes());
MockHttpResponse response = new MockHttpResponse();
dispatcher.invoke(request, response);
assertThat(response.getStatus()).isEqualTo(400);
assertThat(response.getContentAsString()).contains("2qRyyaVcJ1");
}
@Path("/")
static class SimpleResource {
@POST
public void post(ObjectWithEnum o) {
}
}
static class ObjectWithEnum {
public Enum e;
}
enum Enum {
ONE, TWO
}
}

View File

@@ -34,6 +34,7 @@ import sonia.scm.Stage;
import sonia.scm.event.ScmEventBus;
import sonia.scm.event.ScmTestEventBus;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -128,6 +129,21 @@ public class RestartServletTest {
private ServletInputStream createServletInputStream(final InputStream inputStream) {
return new ServletInputStream() {
@Override
public boolean isFinished() {
return false;
}
@Override
public boolean isReady() {
return false;
}
@Override
public void setReadListener(ReadListener readListener) {
}
@Override
public int read() throws IOException {
return inputStream.read();