From 5e696bc131dd97942101fa216e228d64991339c3 Mon Sep 17 00:00:00 2001 From: Raupp Pereira Date: Mon, 5 Jun 2023 19:50:34 +0200 Subject: [PATCH] upgrade jdk and java ee --- .github/workflows/codeql-analysis.yml | 4 +- .github/workflows/maven.yml | 4 +- .../src/it/exchangeMail/pom.xml | 5 +- .../src/it/exchangeMailNoBasePkg/pom.xml | 5 +- .../src/it/v4Sample/pom.xml | 2 +- fit/pom.xml | 36 +- fit/src/it/demo/pom.xml | 2 +- fit/src/it/openType/pom.xml | 2 +- fit/src/it/staticService/pom.xml | 2 +- .../main/java/org/apache/olingo/fit/Demo.java | 28 +- .../org/apache/olingo/fit/KeyAsSegment.java | 30 +- .../java/org/apache/olingo/fit/NorthWind.java | 4 +- .../org/apache/olingo/fit/NorthWindExt.java | 4 +- .../java/org/apache/olingo/fit/OAuth2.java | 2 +- .../java/org/apache/olingo/fit/OpenType.java | 28 +- .../java/org/apache/olingo/fit/Services.java | 42 +- .../org/apache/olingo/fit/Vocabularies.java | 12 +- .../org/apache/olingo/fit/methods/PATCH.java | 2 +- .../olingo/fit/rest/OAuth2Provider.java | 25 +- .../olingo/fit/rest/OAuth2RequestFilter.java | 15 +- .../fit/rest/ServiceNameResponseFilter.java | 8 +- .../fit/rest/StaticSecurityInterceptor.java | 4 +- .../olingo/fit/server/TomcatTestServer.java | 55 ++- .../olingo/fit/utils/AbstractUtilities.java | 4 +- .../apache/olingo/fit/utils/FSManager.java | 2 +- .../olingo/fit/utils/JSONUtilities.java | 2 +- .../apache/olingo/fit/utils/XMLUtilities.java | 2 +- .../webapp/WEB-INF/applicationContext.xml | 22 +- .../olingo/fit/AbstractBaseTestITCase.java | 8 +- .../fit/CXFOAuth2HttpClientFactory.java | 11 +- .../fit/base/ConformanceTestITCase.java | 2 +- .../tecsvc/client/AuthBatchTestITCase.java | 1 - .../fit/tecsvc/client/BatchClientITCase.java | 3 - .../tecsvc/client/BoundOperationITCase.java | 6 +- .../fit/tecsvc/client/ConformanceITCase.java | 2 +- .../tecsvc/client/EntityWithStreamITCase.java | 6 +- .../fit/tecsvc/http/BasicAsyncITCase.java | 20 +- .../http/ODataVersionConformanceITCase.java | 4 +- lib/client-core/pom.xml | 2 +- .../request/AsyncRequestWrapperTest.java | 2 +- .../request/batch/batchResponse.batch | 2 +- .../response/batch/batchResponse.batch | 2 +- lib/commons-core/pom.xml | 2 +- lib/server-api/pom.xml | 6 +- .../olingo/server/api/ODataHttpHandler.java | 4 +- lib/server-core-ext/pom.xml | 25 +- .../olingo/server/core/OData4HttpHandler.java | 4 +- .../core/NettyServiceDispatcherTest.java | 1 - .../server/core/ServiceDispatcherTest.java | 17 +- .../server/example/TripPinServiceTest.java | 14 +- .../olingo/server/example/TripPinServlet.java | 10 +- lib/server-core/pom.xml | 8 +- .../server/core/ODataHttpHandlerImpl.java | 4 +- .../server/core/debug/ServerCoreDebugger.java | 2 +- .../server/core/ContentNegotiatorTest.java | 6 +- .../server/core/ODataHttpHandlerImplTest.java | 2 +- .../batchhandler/MockedBatchHandlerTest.java | 392 +++++++++--------- .../core/debug/ServerCoreDebuggerTest.java | 6 +- .../batch/BatchRequestParserTest.java | 2 +- lib/server-tecsvc/pom.xml | 13 +- .../server/tecsvc/TechnicalServlet.java | 10 +- .../TechnicalServletContextListener.java | 4 +- .../tecsvc/async/TechnicalAsyncService.java | 4 +- .../async/TechnicalStatusMonitorServlet.java | 8 +- .../queryoptions/options/SearchHandler.java | 2 +- lib/server-test/pom.xml | 2 +- .../server/core/ODataHandlerImplTest.java | 18 +- .../core/PreconditionsValidatorTest.java | 2 +- .../server/core/uri/parser/ParserTest.java | 2 +- pom.xml | 40 +- samples/server/pom.xml | 6 +- .../olingo/server/sample/CarsServlet.java | 10 +- .../service/DemoEntityProcessor.java | 2 +- .../mynamespace/web/DemoServlet.java | 10 +- .../service/DemoEntityProcessor.java | 2 +- .../mynamespace/web/DemoServlet.java | 10 +- samples/tutorials/p11_batch/pom.xml | 2 +- .../service/DemoEntityProcessor.java | 2 +- .../mynamespace/web/DemoServlet.java | 10 +- .../service/DemoEntityProcessor.java | 2 +- .../mynamespace/web/DemoServlet.java | 10 +- .../service/DemoEntityProcessor.java | 2 +- .../mynamespace/web/DemoServlet.java | 10 +- .../mynamespace/web/DemoServlet.java | 8 +- .../mynamespace/web/DemoServlet.java | 10 +- .../service/DemoEntityProcessor.java | 2 +- .../mynamespace/web/DemoServlet.java | 10 +- .../mynamespace/web/DemoServlet.java | 10 +- .../mynamespace/web/DemoServlet.java | 10 +- .../mynamespace/web/DemoServlet.java | 10 +- .../mynamespace/web/DemoServlet.java | 10 +- .../mynamespace/web/DemoServlet.java | 10 +- .../service/DemoEntityProcessor.java | 2 +- .../mynamespace/web/DemoServlet.java | 10 +- .../service/DemoEntityProcessor.java | 2 +- .../mynamespace/web/DemoServlet.java | 10 +- .../mynamespace/web/DemoServlet.java | 10 +- 97 files changed, 656 insertions(+), 570 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 46e577b59e..632f945404 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -42,10 +42,10 @@ jobs: with: languages: ${{ matrix.language }} - - name: Set up JDK 8 (Corretto) + - name: Set up JDK 17 (Corretto) uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '17' distribution: 'corretto' cache: maven diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 577499cf6f..140c0db788 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -16,10 +16,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up JDK 8 (Corretto) + - name: Set up JDK 17 (Corretto) uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '17' distribution: 'corretto' cache: maven - name: Build with Maven diff --git a/ext/pojogen-maven-plugin/src/it/exchangeMail/pom.xml b/ext/pojogen-maven-plugin/src/it/exchangeMail/pom.xml index b214ea7052..ff5d8d1d73 100644 --- a/ext/pojogen-maven-plugin/src/it/exchangeMail/pom.xml +++ b/ext/pojogen-maven-plugin/src/it/exchangeMail/pom.xml @@ -30,7 +30,7 @@ A simple IT verifying the basic use case of pojogen-man-plugin. - 1.6 + 17 3.2 UTF-8 @@ -62,6 +62,9 @@ true true -Xlint:unchecked + + ${project.basedir}/target/generated-sources/** + diff --git a/ext/pojogen-maven-plugin/src/it/exchangeMailNoBasePkg/pom.xml b/ext/pojogen-maven-plugin/src/it/exchangeMailNoBasePkg/pom.xml index 0fcb69a199..fa8a222bc9 100644 --- a/ext/pojogen-maven-plugin/src/it/exchangeMailNoBasePkg/pom.xml +++ b/ext/pojogen-maven-plugin/src/it/exchangeMailNoBasePkg/pom.xml @@ -30,7 +30,7 @@ A simple IT verifying the basic use case of pojogen-man-plugin. - 1.6 + 17 3.2 UTF-8 @@ -62,6 +62,9 @@ true true -Xlint:unchecked + + ${project.basedir}/target/generated-sources/** + diff --git a/ext/pojogen-maven-plugin/src/it/v4Sample/pom.xml b/ext/pojogen-maven-plugin/src/it/v4Sample/pom.xml index d2a988ca78..1130e35bc6 100644 --- a/ext/pojogen-maven-plugin/src/it/v4Sample/pom.xml +++ b/ext/pojogen-maven-plugin/src/it/v4Sample/pom.xml @@ -30,7 +30,7 @@ A simple IT verifying the basic use case of pojogen-man-plugin. - 1.6 + 17 3.2 UTF-8 diff --git a/fit/pom.xml b/fit/pom.xml index 25045cf02d..221c0cabff 100644 --- a/fit/pom.xml +++ b/fit/pom.xml @@ -82,8 +82,8 @@ - org.apache.geronimo.specs - geronimo-javamail_1.4_spec + org.apache.geronimo.javamail + geronimo-javamail_1.6_mail org.apache.cxf @@ -102,8 +102,8 @@ jackson-databind - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider org.springframework @@ -111,13 +111,35 @@ + - org.apache.tomcat.embed - tomcat-embed-core + jakarta.inject + jakarta.inject-api + ${jakarta.inject.version} + + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.version} + + + + + javax.activation + activation + ${javax.activation.version} + + + + + org.springframework + spring-context + ${spring.version} + + org.apache.tomcat.embed - tomcat-embed-logging-log4j + tomcat-embed-core org.apache.tomcat diff --git a/fit/src/it/demo/pom.xml b/fit/src/it/demo/pom.xml index 0cfa319728..ffe1867e60 100644 --- a/fit/src/it/demo/pom.xml +++ b/fit/src/it/demo/pom.xml @@ -30,7 +30,7 @@ A simple IT verifying the basic use case of pojogen-maven-plugin. - 1.6 + 17 3.2 UTF-8 diff --git a/fit/src/it/openType/pom.xml b/fit/src/it/openType/pom.xml index 3ae5c847cd..4ca35150bb 100644 --- a/fit/src/it/openType/pom.xml +++ b/fit/src/it/openType/pom.xml @@ -30,7 +30,7 @@ A simple IT verifying the basic use case of pojogen-man-plugin. - 1.6 + 17 3.2 UTF-8 diff --git a/fit/src/it/staticService/pom.xml b/fit/src/it/staticService/pom.xml index 424a17f873..fc7dc8c854 100644 --- a/fit/src/it/staticService/pom.xml +++ b/fit/src/it/staticService/pom.xml @@ -30,7 +30,7 @@ A simple IT verifying the basic use case of pojogen-maven-plugin. - 1.6 + 17 3.2 UTF-8 diff --git a/fit/src/main/java/org/apache/olingo/fit/Demo.java b/fit/src/main/java/org/apache/olingo/fit/Demo.java index 697b7c93a2..a07a0efc1c 100644 --- a/fit/src/main/java/org/apache/olingo/fit/Demo.java +++ b/fit/src/main/java/org/apache/olingo/fit/Demo.java @@ -23,20 +23,20 @@ import java.io.IOException; import java.io.InputStream; -import javax.ws.rs.Consumes; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DefaultValue; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriInfo; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; diff --git a/fit/src/main/java/org/apache/olingo/fit/KeyAsSegment.java b/fit/src/main/java/org/apache/olingo/fit/KeyAsSegment.java index ef8ffa5d07..01d4810c89 100644 --- a/fit/src/main/java/org/apache/olingo/fit/KeyAsSegment.java +++ b/fit/src/main/java/org/apache/olingo/fit/KeyAsSegment.java @@ -23,21 +23,21 @@ import java.io.IOException; import java.io.InputStream; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.DefaultValue; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriInfo; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; diff --git a/fit/src/main/java/org/apache/olingo/fit/NorthWind.java b/fit/src/main/java/org/apache/olingo/fit/NorthWind.java index f5acaedc1d..113ef54b50 100644 --- a/fit/src/main/java/org/apache/olingo/fit/NorthWind.java +++ b/fit/src/main/java/org/apache/olingo/fit/NorthWind.java @@ -20,8 +20,8 @@ import java.io.IOException; -import javax.ws.rs.Path; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; import org.apache.cxf.interceptor.InInterceptors; import org.apache.olingo.fit.rest.XHTTPMethodInterceptor; diff --git a/fit/src/main/java/org/apache/olingo/fit/NorthWindExt.java b/fit/src/main/java/org/apache/olingo/fit/NorthWindExt.java index 61e0df6854..991c7a1109 100644 --- a/fit/src/main/java/org/apache/olingo/fit/NorthWindExt.java +++ b/fit/src/main/java/org/apache/olingo/fit/NorthWindExt.java @@ -20,8 +20,8 @@ import java.io.IOException; -import javax.ws.rs.Path; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; import org.apache.cxf.interceptor.InInterceptors; import org.apache.olingo.fit.rest.ResolvingReferencesInterceptor; diff --git a/fit/src/main/java/org/apache/olingo/fit/OAuth2.java b/fit/src/main/java/org/apache/olingo/fit/OAuth2.java index 9b2c9f1e68..fb32b4738e 100644 --- a/fit/src/main/java/org/apache/olingo/fit/OAuth2.java +++ b/fit/src/main/java/org/apache/olingo/fit/OAuth2.java @@ -20,7 +20,7 @@ import java.io.IOException; -import javax.ws.rs.Path; +import jakarta.ws.rs.Path; import org.springframework.stereotype.Service; diff --git a/fit/src/main/java/org/apache/olingo/fit/OpenType.java b/fit/src/main/java/org/apache/olingo/fit/OpenType.java index a15128e123..8410d6a9e3 100644 --- a/fit/src/main/java/org/apache/olingo/fit/OpenType.java +++ b/fit/src/main/java/org/apache/olingo/fit/OpenType.java @@ -23,20 +23,20 @@ import java.io.IOException; import java.io.InputStream; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.DefaultValue; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriInfo; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; diff --git a/fit/src/main/java/org/apache/olingo/fit/Services.java b/fit/src/main/java/org/apache/olingo/fit/Services.java index 1911bf103e..f59d36a9cd 100644 --- a/fit/src/main/java/org/apache/olingo/fit/Services.java +++ b/fit/src/main/java/org/apache/olingo/fit/Services.java @@ -43,26 +43,26 @@ import javax.mail.Header; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMultipart; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedHashMap; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.core.UriInfo; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.DefaultValue; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.NotFoundException; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedHashMap; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; +import jakarta.ws.rs.core.UriInfo; import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOUtils; @@ -359,7 +359,7 @@ public Response async(@Context final UriInfo uriInfo) { bos.write(Constants.CRLF); bos.write(Constants.CRLF); - bos.write("HTTP/1.1 202 Accepted".getBytes()); + bos.write("HTTP/1.1 202".getBytes()); bos.write(Constants.CRLF); bos.write("Location: http://service-root/async-monitor".getBytes()); bos.write(Constants.CRLF); diff --git a/fit/src/main/java/org/apache/olingo/fit/Vocabularies.java b/fit/src/main/java/org/apache/olingo/fit/Vocabularies.java index c13bf3593f..ff45f82a36 100644 --- a/fit/src/main/java/org/apache/olingo/fit/Vocabularies.java +++ b/fit/src/main/java/org/apache/olingo/fit/Vocabularies.java @@ -20,12 +20,12 @@ import java.io.IOException; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.apache.olingo.fit.metadata.Metadata; import org.apache.olingo.fit.utils.Accept; diff --git a/fit/src/main/java/org/apache/olingo/fit/methods/PATCH.java b/fit/src/main/java/org/apache/olingo/fit/methods/PATCH.java index eb3f5aa3de..b0c612f2ed 100644 --- a/fit/src/main/java/org/apache/olingo/fit/methods/PATCH.java +++ b/fit/src/main/java/org/apache/olingo/fit/methods/PATCH.java @@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import javax.ws.rs.HttpMethod; +import jakarta.ws.rs.HttpMethod; @Target({ ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) diff --git a/fit/src/main/java/org/apache/olingo/fit/rest/OAuth2Provider.java b/fit/src/main/java/org/apache/olingo/fit/rest/OAuth2Provider.java index 0e3abf84ff..74ac41f4c1 100644 --- a/fit/src/main/java/org/apache/olingo/fit/rest/OAuth2Provider.java +++ b/fit/src/main/java/org/apache/olingo/fit/rest/OAuth2Provider.java @@ -18,8 +18,8 @@ */ package org.apache.olingo.fit.rest; -import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; import org.apache.cxf.rs.security.oauth2.common.AccessTokenRegistration; import org.apache.cxf.rs.security.oauth2.common.Client; @@ -31,6 +31,8 @@ import org.apache.cxf.rs.security.oauth2.grants.code.ServerAuthorizationCodeGrant; import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException; import org.apache.cxf.rs.security.oauth2.tokens.bearer.BearerAccessToken; +import org.apache.cxf.rs.security.oauth2.tokens.refresh.RefreshToken; + public class OAuth2Provider implements AuthorizationCodeDataProvider { @@ -65,7 +67,7 @@ public ServerAccessToken getPreauthorizedToken( @Override public List convertScopeToPermissions(final Client client, final List list) { - return Collections.singletonList(new OAuthPermission()); + return list.stream().map(l -> new OAuthPermission((l))).collect(Collectors.toList()); } @Override @@ -118,14 +120,23 @@ public ServerAccessToken refreshAccessToken( } @Override - public void removeAccessToken(final ServerAccessToken sat) throws OAuthServiceException { - if (token != null && token.getTokenKey().equals(sat.getTokenKey())) { - token = null; - } + public void revokeToken(final Client client, final String string, final String string1) throws OAuthServiceException { + throw new UnsupportedOperationException("Not supported yet."); } @Override - public void revokeToken(final Client client, final String string, final String string1) throws OAuthServiceException { + public List + getCodeGrants(Client client, UserSubject userSubject) throws OAuthServiceException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getAccessTokens(Client client, UserSubject userSubject) throws OAuthServiceException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getRefreshTokens(Client client, UserSubject userSubject) throws OAuthServiceException { throw new UnsupportedOperationException("Not supported yet."); } diff --git a/fit/src/main/java/org/apache/olingo/fit/rest/OAuth2RequestFilter.java b/fit/src/main/java/org/apache/olingo/fit/rest/OAuth2RequestFilter.java index a7ab945c03..e0004165ec 100644 --- a/fit/src/main/java/org/apache/olingo/fit/rest/OAuth2RequestFilter.java +++ b/fit/src/main/java/org/apache/olingo/fit/rest/OAuth2RequestFilter.java @@ -18,15 +18,26 @@ */ package org.apache.olingo.fit.rest; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.ext.Provider; +import jakarta.inject.Inject; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.ext.Provider; import org.apache.commons.lang3.StringUtils; +import org.apache.cxf.jaxrs.ext.MessageContext; +import org.apache.cxf.rs.security.jose.jwt.JoseJwtConsumer; import org.apache.cxf.rs.security.oauth2.filters.OAuthRequestFilter; @Provider public class OAuth2RequestFilter extends OAuthRequestFilter { + @Inject + public OAuth2RequestFilter(JoseJwtConsumer joseJwtConsumer, OAuth2Provider oAuth2Provider, + MessageContext messageContext) { + super.setJwtTokenConsumer(joseJwtConsumer); + super.setDataProvider(oAuth2Provider); + this.setMessageContext(messageContext); + + } @Override public void filter(final ContainerRequestContext context) { final String svcName = diff --git a/fit/src/main/java/org/apache/olingo/fit/rest/ServiceNameResponseFilter.java b/fit/src/main/java/org/apache/olingo/fit/rest/ServiceNameResponseFilter.java index 9540c1e7db..fbdc8de414 100644 --- a/fit/src/main/java/org/apache/olingo/fit/rest/ServiceNameResponseFilter.java +++ b/fit/src/main/java/org/apache/olingo/fit/rest/ServiceNameResponseFilter.java @@ -23,10 +23,10 @@ import java.io.IOException; import java.io.InputStream; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerResponseContext; -import javax.ws.rs.container.ContainerResponseFilter; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerResponseContext; +import jakarta.ws.rs.container.ContainerResponseFilter; +import jakarta.ws.rs.ext.Provider; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; diff --git a/fit/src/main/java/org/apache/olingo/fit/rest/StaticSecurityInterceptor.java b/fit/src/main/java/org/apache/olingo/fit/rest/StaticSecurityInterceptor.java index 453c08613b..38776233ff 100644 --- a/fit/src/main/java/org/apache/olingo/fit/rest/StaticSecurityInterceptor.java +++ b/fit/src/main/java/org/apache/olingo/fit/rest/StaticSecurityInterceptor.java @@ -23,8 +23,8 @@ import java.util.Map; import java.util.StringTokenizer; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.Response; import org.apache.cxf.common.security.SimplePrincipal; import org.apache.cxf.interceptor.Fault; diff --git a/fit/src/main/java/org/apache/olingo/fit/server/TomcatTestServer.java b/fit/src/main/java/org/apache/olingo/fit/server/TomcatTestServer.java index 9d2c4e4ed0..fdb2ba6d33 100644 --- a/fit/src/main/java/org/apache/olingo/fit/server/TomcatTestServer.java +++ b/fit/src/main/java/org/apache/olingo/fit/server/TomcatTestServer.java @@ -35,22 +35,25 @@ import java.util.logging.Level; import java.util.logging.SimpleFormatter; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpSessionEvent; -import javax.servlet.http.HttpSessionListener; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.http.HttpSessionEvent; +import jakarta.servlet.http.HttpSessionListener; import org.apache.catalina.Context; import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleState; +import org.apache.catalina.loader.WebappClassLoader; +import org.apache.catalina.loader.WebappClassLoaderBase; import org.apache.catalina.loader.WebappLoader; import org.apache.catalina.startup.Tomcat; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; +import org.apache.tomcat.util.http.LegacyCookieProcessor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -66,10 +69,11 @@ private TomcatTestServer(final Tomcat tomcat) { this.tomcat = tomcat; } - public static void main(final String[] params) { + public static void main(final String[] params) throws LifecycleException { + TestServerBuilder server = null; try { LOG.trace("Start tomcat embedded server from main()"); - TestServerBuilder server = TomcatTestServer.init(9180) + server = TomcatTestServer.init(9180) .addStaticContent("/stub/StaticService/V40/OpenType.svc/$metadata", "V40/openTypeMetadata.xml") .addStaticContent("/stub/StaticService/V40/Demo.svc/$metadata", "V40/demoMetadata.xml") .addStaticContent("/stub/StaticService/V40/Static.svc/$metadata", "V40/metadata.xml"); @@ -96,6 +100,8 @@ public static void main(final String[] params) { throw new RuntimeException("Failed to start Tomcat server from main method.", e); } catch (LifecycleException e) { throw new RuntimeException("Failed to start Tomcat server from main method.", e); + } finally { + server.stop(); } } @@ -240,7 +246,11 @@ public TestServerBuilder addWebApp(final boolean copy) throws IOException { String contextPath = "/stub"; Context context = tomcat.addWebapp(tomcat.getHost(), contextPath, webAppDir.getAbsolutePath()); - context.setLoader(new WebappLoader(Thread.currentThread().getContextClassLoader())); + WebappLoader webappLoader = new WebappLoader(); + WebappClassLoaderBase webappClassLoaderBase = + new WebappClassLoader(Thread.currentThread().getContextClassLoader()); + webappLoader.setLoaderInstance(webappClassLoaderBase); + context.setLoader(webappLoader); LOG.info("Webapp {} at context {}.", webAppDir.getName(), contextPath); return this; @@ -272,7 +282,7 @@ public TestServerBuilder addServlet(final Class factoryCl Context cxt = getContext(); String randomServletId = UUID.randomUUID().toString(); Tomcat.addServlet(cxt, randomServletId, httpServlet); - cxt.addServletMapping(path, randomServletId); + cxt.addServletMappingDecoded(path, randomServletId); LOG.info("Added servlet {} at context {} (mapping id={}).", servletClassname, path, randomServletId); return this; } @@ -291,7 +301,7 @@ public TestServerBuilder addAuthServlet(final Class facto cxt.setAltDDName(webXMLPath); String randomServletId = UUID.randomUUID().toString(); Tomcat.addServlet(cxt, randomServletId, httpServlet); - cxt.addServletMapping(contextPath, randomServletId); + cxt.addServletMappingDecoded(contextPath, randomServletId); return this; } @@ -315,7 +325,7 @@ public TestServerBuilder addServlet(final HttpServlet httpServlet, final String } Context cxt = getContext(); Tomcat.addServlet(cxt, name, httpServlet); - cxt.addServletMapping(path, name); + cxt.addServletMappingDecoded(path, name); // LOG.info("Added servlet {} at context {}.", name, path); return this; @@ -325,7 +335,8 @@ public TestServerBuilder addServlet(final HttpServlet httpServlet, final String private Context getContext() { if (baseContext == null) { - baseContext = tomcat.addContext("/", baseDir.getAbsolutePath()); + baseContext = tomcat.addContext("", baseDir.getAbsolutePath()); + baseContext.setCookieProcessor(new LegacyCookieProcessor()); } return baseContext; } @@ -349,15 +360,15 @@ public void startAndWait() throws LifecycleException { start(); tomcat.getServer().await(); } - } - public void stop() throws LifecycleException { - if (tomcat.getServer() != null - && tomcat.getServer().getState() != LifecycleState.DESTROYED) { - if (tomcat.getServer().getState() != LifecycleState.STOPPED) { - tomcat.stop(); + public void stop() throws LifecycleException { + if (tomcat.getServer() != null + && tomcat.getServer().getState() != LifecycleState.DESTROYED) { + if (tomcat.getServer().getState() != LifecycleState.STOPPED) { + tomcat.stop(); + } + tomcat.destroy(); } - tomcat.destroy(); } } diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java b/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java index a14cb8b8fb..a0083f6673 100644 --- a/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java +++ b/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java @@ -35,8 +35,8 @@ import java.util.Set; import java.util.UUID; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.NotFoundException; +import jakarta.ws.rs.core.Response; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java b/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java index d79ebf05d2..f35923726e 100644 --- a/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java +++ b/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java @@ -26,7 +26,7 @@ import java.io.OutputStream; import java.io.OutputStreamWriter; -import javax.ws.rs.NotFoundException; +import jakarta.ws.rs.NotFoundException; import org.apache.commons.io.IOUtils; import org.apache.commons.vfs2.FileObject; diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/JSONUtilities.java b/fit/src/main/java/org/apache/olingo/fit/utils/JSONUtilities.java index b18886d64f..846ce1b98f 100644 --- a/fit/src/main/java/org/apache/olingo/fit/utils/JSONUtilities.java +++ b/fit/src/main/java/org/apache/olingo/fit/utils/JSONUtilities.java @@ -31,7 +31,7 @@ import java.util.Map; import java.util.Set; -import javax.ws.rs.NotFoundException; +import jakarta.ws.rs.NotFoundException; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/XMLUtilities.java b/fit/src/main/java/org/apache/olingo/fit/utils/XMLUtilities.java index 293d631231..524e759a58 100644 --- a/fit/src/main/java/org/apache/olingo/fit/utils/XMLUtilities.java +++ b/fit/src/main/java/org/apache/olingo/fit/utils/XMLUtilities.java @@ -40,7 +40,7 @@ import java.util.Set; import java.util.regex.Pattern; -import javax.ws.rs.NotFoundException; +import jakarta.ws.rs.NotFoundException; import javax.xml.namespace.QName; import javax.xml.stream.XMLEventFactory; import javax.xml.stream.XMLEventReader; diff --git a/fit/src/main/webapp/WEB-INF/applicationContext.xml b/fit/src/main/webapp/WEB-INF/applicationContext.xml index f1320b95ee..cb7c5d03a6 100644 --- a/fit/src/main/webapp/WEB-INF/applicationContext.xml +++ b/fit/src/main/webapp/WEB-INF/applicationContext.xml @@ -22,32 +22,46 @@ + http://www.springframework.org/schema/context/spring-context.xsd + http://www.springframework.org/schema/context/spring-context.xsd + http://www.springframework.org/schema/util + http://www.springframework.org/schema/util/spring-util.xsd"> - + - + + + + foo + bar + + + + - + + + diff --git a/fit/src/test/java/org/apache/olingo/fit/AbstractBaseTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/AbstractBaseTestITCase.java index 5ac6133870..cf1e90aa54 100644 --- a/fit/src/test/java/org/apache/olingo/fit/AbstractBaseTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/AbstractBaseTestITCase.java @@ -20,10 +20,10 @@ import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.catalina.LifecycleException; import org.apache.commons.io.IOUtils; diff --git a/fit/src/test/java/org/apache/olingo/fit/CXFOAuth2HttpClientFactory.java b/fit/src/test/java/org/apache/olingo/fit/CXFOAuth2HttpClientFactory.java index 59f351f372..42a758a0b8 100644 --- a/fit/src/test/java/org/apache/olingo/fit/CXFOAuth2HttpClientFactory.java +++ b/fit/src/test/java/org/apache/olingo/fit/CXFOAuth2HttpClientFactory.java @@ -21,7 +21,7 @@ import java.io.IOException; import java.net.URI; -import javax.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MediaType; import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang3.StringUtils; @@ -49,14 +49,16 @@ import org.apache.olingo.client.core.http.AbstractOAuth2HttpClientFactory; import org.apache.olingo.client.core.http.OAuth2Exception; import org.apache.olingo.fit.rest.OAuth2Provider; +import org.apache.cxf.rs.security.oauth2.client.Consumer; + import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.dataformat.xml.XmlMapper; public class CXFOAuth2HttpClientFactory extends AbstractOAuth2HttpClientFactory { - private static final OAuthClientUtils.Consumer OAUTH2_CONSUMER = - new OAuthClientUtils.Consumer(OAuth2Provider.CLIENT_ID, OAuth2Provider.CLIENT_SECRET); + private static final Consumer OAUTH2_CONSUMER = + new Consumer(OAuth2Provider.CLIENT_ID, OAuth2Provider.CLIENT_SECRET); private ClientAccessToken accessToken; @@ -85,7 +87,7 @@ protected void init() throws OAuth2Exception { OAuth2Provider.CLIENT_ID, OAuth2Provider.REDIRECT_URI, null, - null); + "foo bar"); // Disable automatic redirects handling final HttpParams params = new BasicHttpParams(); @@ -120,6 +122,7 @@ protected void init() throws OAuth2Exception { addParameter("client_id", oAuthAuthorizationData.get("clientId").asText()). addParameter("redirect_uri", oAuthAuthorizationData.get("redirectUri").asText()). addParameter("oauthDecision", "allow"). + addParameter("scope", "foo bar"). build(); final HttpGet method = new HttpGet(location); method.addHeader("Authorization", "Basic " + Base64.encodeBase64String("odatajclient:odatajclient".getBytes())); diff --git a/fit/src/test/java/org/apache/olingo/fit/base/ConformanceTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/base/ConformanceTestITCase.java index 23215a33bb..21a386742e 100644 --- a/fit/src/test/java/org/apache/olingo/fit/base/ConformanceTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/base/ConformanceTestITCase.java @@ -249,7 +249,7 @@ public void item12() { assertEquals("application/json;odata.metadata=minimal", req.getAccept()); final ODataRetrieveResponse res = req.execute(); - assertTrue(res.getContentType().startsWith("application/json; odata.metadata=minimal")); + assertTrue(res.getContentType().startsWith("application/json;odata.metadata=minimal")); assertNotNull(res.getBody()); } diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/AuthBatchTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/AuthBatchTestITCase.java index 259aabc005..7639016d93 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/AuthBatchTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/AuthBatchTestITCase.java @@ -97,7 +97,6 @@ private void batchRequest(final ODataClient client, final String baseURL) throws final ODataBatchResponse response = streamManager.getResponse(); assertEquals(200, response.getStatusCode()); - assertEquals("OK", response.getStatusMessage()); } } diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java index d92d7b3acf..2fb6b61a18 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java @@ -133,7 +133,6 @@ public void emptyBatchRequest() { saveCookieHeader(response); assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode()); - assertEquals("OK", response.getStatusMessage()); final Iterator iter = response.getBody(); assertFalse(iter.hasNext()); @@ -151,7 +150,6 @@ public void getBatchRequestWithRelativeUris() { saveCookieHeader(response); assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode()); - assertEquals("OK", response.getStatusMessage()); final Iterator iter = response.getBody(); assertTrue(iter.hasNext()); @@ -183,7 +181,6 @@ public void getBatchRequest() { saveCookieHeader(response); assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode()); - assertEquals("OK", response.getStatusMessage()); final Iterator iter = response.getBody(); assertTrue(iter.hasNext()); diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BoundOperationITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BoundOperationITCase.java index 38a985ece3..f9fe0fd967 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BoundOperationITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BoundOperationITCase.java @@ -64,7 +64,7 @@ public void readEntitySetOperation() { final ODataRetrieveResponse response = request.execute(); saveCookieHeader(response); assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode()); - assertEquals("application/json; odata.metadata=full", response.getContentType()); + assertEquals("application/json;odata.metadata=full", response.getContentType()); final ClientEntitySet entitySet = response.getBody(); assertNotNull(entitySet); @@ -124,7 +124,7 @@ public void readComplexPropertyOperation() { final ODataRetrieveResponse response = request.execute(); saveCookieHeader(response); assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode()); - assertEquals("application/json; odata.metadata=full", response.getContentType()); + assertEquals("application/json;odata.metadata=full", response.getContentType()); final ClientProperty property = response.getBody(); assertNotNull(property); @@ -151,7 +151,7 @@ public void invokeFunction(){ final ODataRetrieveResponse response = request.execute(); saveCookieHeader(response); assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode()); - assertEquals("application/json; odata.metadata=full", response.getContentType()); + assertEquals("application/json;odata.metadata=full", response.getContentType()); final ClientEntitySet entitySet = response.getBody(); assertNotNull(entitySet); diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ConformanceITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ConformanceITCase.java index 831499af3d..6585182c14 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ConformanceITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ConformanceITCase.java @@ -245,7 +245,7 @@ public void supportMetadataMinimal() { assertEquals("application/json;odata.metadata=minimal", req.getAccept()); final ODataRetrieveResponse res = req.execute(); - assertTrue(res.getContentType().startsWith("application/json; odata.metadata=minimal")); + assertTrue(res.getContentType().startsWith("application/json;odata.metadata=minimal")); assertNotNull(res.getBody()); } diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/EntityWithStreamITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/EntityWithStreamITCase.java index 39eae0ee57..e7215e5f13 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/EntityWithStreamITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/EntityWithStreamITCase.java @@ -66,7 +66,7 @@ public void readEntitySetWithStreamProperty() { final ODataRetrieveResponse response = request.execute(); saveCookieHeader(response); assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode()); - assertEquals("application/json; odata.metadata=full", response.getContentType()); + assertEquals("application/json;odata.metadata=full", response.getContentType()); final ClientEntitySet entitySet = response.getBody(); assertNotNull(entitySet); @@ -132,7 +132,7 @@ public void readExpandOfStreamPropOnComplexProperty() { final ODataRetrieveResponse response = request.execute(); saveCookieHeader(response); assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode()); - assertEquals("application/json; odata.metadata=full", response.getContentType()); + assertEquals("application/json;odata.metadata=full", response.getContentType()); final ClientEntity entity = response.getBody(); assertNotNull(entity); @@ -194,7 +194,7 @@ public void readExpandOfStreamPropOnComplexPropertyWithRef() { final ODataRetrieveResponse response = request.execute(); saveCookieHeader(response); assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode()); - assertEquals("application/json; odata.metadata=full", response.getContentType()); + assertEquals("application/json;odata.metadata=full", response.getContentType()); final ClientEntity entity = response.getBody(); assertNotNull(entity); diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicAsyncITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicAsyncITCase.java index 2763d48fff..8b4dbdcf90 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicAsyncITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicAsyncITCase.java @@ -74,7 +74,7 @@ public void batchAsync() throws Exception { assertEquals(0, response.byteLength()); Map> headerFields = connection.getHeaderFields(); - assertEquals("HTTP/1.1 202 Accepted", headerFields.get(null).get(0)); + assertEquals("HTTP/1.1 202", headerFields.get(null).get(0)); assertTrue(Pattern.matches("http:\\/\\/localhost:9080\\/odata-server-tecsvc\\/status\\/\\d*", headerFields.get("Location").get(0))); assertEquals("respond-async", headerFields.get("Preference-Applied").get(0)); @@ -84,7 +84,7 @@ public void batchAsync() throws Exception { HttpURLConnection statusRequest = getRequest(new URL(respondUri), Collections.emptyMap()); StringHelper.Stream statusBody = StringHelper.toStream(statusRequest.getInputStream()); Map> statusHeaderFields = statusRequest.getHeaderFields(); - assertEquals("HTTP/1.1 202 Accepted", statusHeaderFields.get(null).get(0)); + assertEquals("HTTP/1.1 202", statusHeaderFields.get(null).get(0)); assertEquals(0, statusBody.byteLength()); // get async response (now finished) @@ -94,10 +94,10 @@ public void batchAsync() throws Exception { Map> resultHeaderFields = result.getHeaderFields(); String resBody = resultBody.asString(); - assertEquals("HTTP/1.1 200 OK", resultHeaderFields.get(null).get(0)); + assertEquals("HTTP/1.1 200", resultHeaderFields.get(null).get(0)); assertEquals(1007, resultBody.byteLength()); contains(resBody, - "HTTP/1.1 200 OK", + "HTTP/1.1 200", "OData-Version: 4.0", "Content-Length: 605", "\"@odata.context\":\"$metadata#ESAllPrim/$entity\"", @@ -117,7 +117,7 @@ public void asyncChangesetViaPost() throws Exception { assertEquals(0, response.byteLength()); Map> headerFields = connection.getHeaderFields(); - assertEquals("HTTP/1.1 202 Accepted", headerFields.get(null).get(0)); + assertEquals("HTTP/1.1 202", headerFields.get(null).get(0)); // because of generated status id it is only checked that the location starts correct and contains a number assertTrue(Pattern.matches("http:\\/\\/localhost:9080\\/odata-server-tecsvc\\/status\\/\\d*", headerFields.get("Location").get(0))); @@ -128,7 +128,7 @@ public void asyncChangesetViaPost() throws Exception { HttpURLConnection statusRequest = getRequest(new URL(respondUri), Collections.emptyMap()); StringHelper.Stream statusBody = StringHelper.toStream(statusRequest.getInputStream()); Map> statusHeaderFields = statusRequest.getHeaderFields(); - assertEquals("HTTP/1.1 202 Accepted", statusHeaderFields.get(null).get(0)); + assertEquals("HTTP/1.1 202", statusHeaderFields.get(null).get(0)); assertEquals(0, statusBody.byteLength()); // get async response (now finished) @@ -136,10 +136,10 @@ public void asyncChangesetViaPost() throws Exception { StringHelper.Stream resultBody = StringHelper.toStream(result.getInputStream()); Map> resultHeaderFields = result.getHeaderFields(); String resBody = resultBody.asString(); - assertEquals("HTTP/1.1 200 OK", resultHeaderFields.get(null).get(0)); + assertEquals("HTTP/1.1 200", resultHeaderFields.get(null).get(0)); assertEquals(2321, resultBody.byteLength()); contains(resBody, - "HTTP/1.1 200 OK", + "HTTP/1.1 200", "OData-Version: 4.0", "Content-Length: 605", "\"@odata.context\":\"$metadata#ESAllPrim/$entity\"", @@ -192,10 +192,10 @@ private HttpURLConnection waitTillDone(String location, int maxWaitInSeconds) th HttpURLConnection statusRequest = getRequest(new URL(location), Collections.emptyMap()); Map> statusHeaderFields = statusRequest.getHeaderFields(); String statusHeader = statusHeaderFields.get(null).get(0); - if("HTTP/1.1 202 Accepted".equals(statusHeader)) { + if("HTTP/1.1 202".equals(statusHeader)) { TimeUnit.MILLISECONDS.sleep(SLEEP_TIMEOUT_IN_MS); waitCounter -= SLEEP_TIMEOUT_IN_MS; - } else if("HTTP/1.1 200 OK".equals(statusHeader)) { + } else if("HTTP/1.1 200".equals(statusHeader)) { result = statusRequest; } else { throw new RuntimeException("Unexpected status header ('" + statusHeader + diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/ODataVersionConformanceITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/ODataVersionConformanceITCase.java index 3a57e6a8ba..b86b5be09a 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/ODataVersionConformanceITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/ODataVersionConformanceITCase.java @@ -130,7 +130,7 @@ public void validODataVersionAndMaxVersionHeader1() throws Exception { assertEquals(HttpStatusCode.OK.getStatusCode(), connection.getResponseCode()); assertEquals("4.0", connection.getHeaderField(HttpHeader.ODATA_VERSION)); - assertEquals("application/json; odata.metadata=minimal", + assertEquals("application/json;odata.metadata=minimal", connection.getHeaderField(HttpHeader.CONTENT_TYPE)); final String content = IOUtils.toString(connection.getInputStream(), Charset.defaultCharset()); @@ -149,7 +149,7 @@ public void validODataVersionAndMaxVersionHeader2() throws Exception { assertEquals(HttpStatusCode.OK.getStatusCode(), connection.getResponseCode()); assertEquals("4.0", connection.getHeaderField(HttpHeader.ODATA_VERSION)); - assertEquals("application/json; odata.metadata=minimal", + assertEquals("application/json;odata.metadata=minimal", connection.getHeaderField(HttpHeader.CONTENT_TYPE)); final String content = IOUtils.toString(connection.getInputStream(), Charset.defaultCharset()); diff --git a/lib/client-core/pom.xml b/lib/client-core/pom.xml index f6634c914d..8fe7f02caa 100644 --- a/lib/client-core/pom.xml +++ b/lib/client-core/pom.xml @@ -95,7 +95,7 @@ org.mockito - mockito-all + mockito-core test diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/communication/request/AsyncRequestWrapperTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/communication/request/AsyncRequestWrapperTest.java index 0287e0d561..50d6c45c1f 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/communication/request/AsyncRequestWrapperTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/communication/request/AsyncRequestWrapperTest.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/communication/request/batch/batchResponse.batch b/lib/client-core/src/test/resources/org/apache/olingo/client/core/communication/request/batch/batchResponse.batch index f9e043b2c8..b39cd888f8 100644 --- a/lib/client-core/src/test/resources/org/apache/olingo/client/core/communication/request/batch/batchResponse.batch +++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/communication/request/batch/batchResponse.batch @@ -28,7 +28,7 @@ Content-Type: application/http Content-Transfer-Encoding: binary Content-ID: 2 -HTTP/1.1 200 OK +HTTP/1.1 200 DataServiceVersion: 2.0 Content-Type: text/plain;charset=utf-8 Content-length: 13 diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/communication/response/batch/batchResponse.batch b/lib/client-core/src/test/resources/org/apache/olingo/client/core/communication/response/batch/batchResponse.batch index f9e043b2c8..b39cd888f8 100644 --- a/lib/client-core/src/test/resources/org/apache/olingo/client/core/communication/response/batch/batchResponse.batch +++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/communication/response/batch/batchResponse.batch @@ -28,7 +28,7 @@ Content-Type: application/http Content-Transfer-Encoding: binary Content-ID: 2 -HTTP/1.1 200 OK +HTTP/1.1 200 DataServiceVersion: 2.0 Content-Type: text/plain;charset=utf-8 Content-length: 13 diff --git a/lib/commons-core/pom.xml b/lib/commons-core/pom.xml index caae69d6ad..a6a5c3a723 100644 --- a/lib/commons-core/pom.xml +++ b/lib/commons-core/pom.xml @@ -52,7 +52,7 @@ org.mockito - mockito-all + mockito-core test diff --git a/lib/server-api/pom.xml b/lib/server-api/pom.xml index 96e93b5384..ee2cc2103d 100644 --- a/lib/server-api/pom.xml +++ b/lib/server-api/pom.xml @@ -41,9 +41,9 @@ ${project.version} - javax.servlet - servlet-api - 2.5 + jakarta.servlet + jakarta.servlet-api + ${jakarta.servlet.version} provided diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataHttpHandler.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataHttpHandler.java index 61e0f0f939..ff66c3ba56 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataHttpHandler.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataHttpHandler.java @@ -18,8 +18,8 @@ */ package org.apache.olingo.server.api; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.olingo.server.api.debug.DebugSupport; import org.apache.olingo.server.api.etag.CustomETagSupport; diff --git a/lib/server-core-ext/pom.xml b/lib/server-core-ext/pom.xml index 84c00a9c8b..0645885c2e 100644 --- a/lib/server-core-ext/pom.xml +++ b/lib/server-core-ext/pom.xml @@ -50,11 +50,17 @@ ${project.version} - javax.servlet - javax.servlet-api - 3.0.1 + jakarta.servlet + jakarta.servlet-api + ${jakarta.servlet.version} provided + + jakarta.annotation + jakarta.annotation-api + ${jakarta.annotation.version} + test + junit junit @@ -62,7 +68,7 @@ org.mockito - mockito-all + mockito-core test @@ -80,21 +86,10 @@ tomcat-embed-core test - - org.apache.tomcat.embed - tomcat-embed-logging-log4j - test - org.apache.tomcat tomcat-jasper test - - - javax.servlet - javax.servlet-api - - diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/OData4HttpHandler.java b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/OData4HttpHandler.java index 5c2c204cff..c81ba644d2 100644 --- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/OData4HttpHandler.java +++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/OData4HttpHandler.java @@ -20,8 +20,8 @@ import java.io.IOException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; import org.apache.olingo.commons.api.format.ContentType; diff --git a/lib/server-core-ext/src/test/java/org/apache/olingo/netty/server/core/NettyServiceDispatcherTest.java b/lib/server-core-ext/src/test/java/org/apache/olingo/netty/server/core/NettyServiceDispatcherTest.java index 358b8fe3ee..17cc2c5006 100644 --- a/lib/server-core-ext/src/test/java/org/apache/olingo/netty/server/core/NettyServiceDispatcherTest.java +++ b/lib/server-core-ext/src/test/java/org/apache/olingo/netty/server/core/NettyServiceDispatcherTest.java @@ -267,7 +267,6 @@ public void testMetadata() throws Exception { handler.processNettyRequest(nettyRequest, nettyResponse, requestParams); assertNotNull(new String (nettyResponse.content().array())); assertEquals(200, nettyResponse.status().code()); - assertEquals("OK", nettyResponse.status().reasonPhrase()); } @Test diff --git a/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/ServiceDispatcherTest.java b/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/ServiceDispatcherTest.java index 53adc2e0f9..b5fef86221 100644 --- a/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/ServiceDispatcherTest.java +++ b/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/ServiceDispatcherTest.java @@ -27,9 +27,9 @@ import java.io.IOException; import java.net.URI; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.catalina.Context; import org.apache.catalina.startup.Tomcat; @@ -60,6 +60,7 @@ import org.apache.olingo.server.core.responses.PrimitiveValueResponse; import org.apache.olingo.server.core.responses.PropertyResponse; import org.apache.olingo.server.core.responses.StreamResponse; +import org.junit.After; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; @@ -102,11 +103,13 @@ public void beforeTest(ServiceHandler serviceHandler) throws Exception { tomcat.getHost().setAppBase(baseDir.getAbsolutePath()); Context cxt = tomcat.addContext("/trippin", baseDir.getAbsolutePath()); Tomcat.addServlet(cxt, "trippin", new SampleODataServlet(serviceHandler, metadata)); - cxt.addServletMapping("/*", "trippin"); + cxt.addServletMappingDecoded("/*", "trippin"); tomcat.setPort(TOMCAT_PORT); + tomcat.getConnector().setSecure(false); tomcat.start(); } + @After public void afterTest() throws Exception { tomcat.stop(); tomcat.destroy(); @@ -136,7 +139,6 @@ private void helpGETTest(ServiceHandler handler, String path, TestResult validat beforeTest(handler); httpGET("http://localhost:" + TOMCAT_PORT + "/" + path); validator.validate(); - afterTest(); } private void helpTest(ServiceHandler handler, String path, String method, String payload, @@ -163,7 +165,6 @@ private void helpTest(ServiceHandler handler, String path, String method, String http.execute(getLocalhost(), request); validator.validate(); - afterTest(); } @Test @@ -186,7 +187,7 @@ public void testEntitySet() throws Exception { @Override public void validate() throws Exception { ArgumentCaptor arg1 = ArgumentCaptor.forClass(DataRequest.class); - ArgumentCaptor arg2 = ArgumentCaptor.forClass(EntityResponse.class); + ArgumentCaptor arg2 = ArgumentCaptor.forClass(EntitySetResponse.class); Mockito.verify(handler).read(arg1.capture(), arg2.capture()); DataRequest request = arg1.getValue(); @@ -323,7 +324,7 @@ public void testFunctionImport() throws Exception { @Override public void validate() throws Exception { ArgumentCaptor arg1 = ArgumentCaptor.forClass(FunctionRequest.class); - ArgumentCaptor arg3 = ArgumentCaptor.forClass(PropertyResponse.class); + ArgumentCaptor arg3 = ArgumentCaptor.forClass(EntityResponse.class); ArgumentCaptor arg2 = ArgumentCaptor.forClass(HttpMethod.class); Mockito.verify(handler).invoke(arg1.capture(), arg2.capture(), arg3.capture()); diff --git a/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServiceTest.java b/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServiceTest.java index 5d2a13d18d..de0cf0aab2 100644 --- a/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServiceTest.java +++ b/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServiceTest.java @@ -41,6 +41,8 @@ import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.impl.conn.PoolingClientConnectionManager; +import org.apache.http.impl.conn.SchemeRegistryFactory; import org.apache.http.util.EntityUtils; import org.apache.olingo.commons.api.http.HttpHeader; import org.junit.AfterClass; @@ -67,13 +69,21 @@ public class TripPinServiceTest { @BeforeClass public static void beforeTest() throws Exception { + PoolingClientConnectionManager conMan = + new PoolingClientConnectionManager(SchemeRegistryFactory.createDefault()); + conMan.setMaxTotal(200); + conMan.setDefaultMaxPerRoute(200); + http = new DefaultHttpClient(conMan); tomcat.setPort(TOMCAT_PORT); File baseDir = new File(System.getProperty("java.io.tmpdir")); tomcat.setBaseDir(baseDir.getAbsolutePath()); tomcat.getHost().setAppBase(baseDir.getAbsolutePath()); + tomcat.getHost().setDeployOnStartup(true); + tomcat.getConnector().setSecure(false); + tomcat.setSilent(true); Context cxt = tomcat.addContext("/trippin", baseDir.getAbsolutePath()); Tomcat.addServlet(cxt, "trippin", new TripPinServlet()); - cxt.addServletMapping("/*", "trippin"); + cxt.addServletMappingDecoded("/*", "trippin"); baseURL = "http://" + tomcat.getHost().getName() + ":"+ TOMCAT_PORT+"/trippin"; tomcat.start(); } @@ -192,7 +202,7 @@ public void testReadEntityWithFullMetadata() throws Exception { public void testErrorResponse() throws Exception { HttpResponse response = httpGET(baseURL + "/Airlines(1)", 400); Header[] headers = response.getHeaders("Content-Type"); - assertEquals("application/json; odata.metadata=minimal", headers[0].getValue()); + assertEquals("application/json;odata.metadata=minimal", headers[0].getValue()); assertEquals("{\"error\":{\"code\":null,\"message\":\"The key value '' is invalid.\"}}", IOUtils.toString(response.getEntity().getContent())); } diff --git a/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServlet.java b/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServlet.java index 7ab019d23a..a46f35ea51 100644 --- a/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServlet.java +++ b/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinServlet.java @@ -21,11 +21,11 @@ import java.io.FileReader; import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import javax.xml.stream.XMLStreamException; import org.apache.olingo.server.api.OData; diff --git a/lib/server-core/pom.xml b/lib/server-core/pom.xml index fbb4324292..7106e34db4 100644 --- a/lib/server-core/pom.xml +++ b/lib/server-core/pom.xml @@ -46,9 +46,9 @@ ${project.version} - javax.servlet - servlet-api - 2.5 + jakarta.servlet + jakarta.servlet-api + ${jakarta.servlet.version} provided @@ -77,7 +77,7 @@ org.mockito - mockito-all + mockito-core test diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java index 657696803d..d8a103bfe8 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java @@ -32,8 +32,8 @@ import java.util.Map; import java.util.Map.Entry; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.http.HttpHeader; diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ServerCoreDebugger.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ServerCoreDebugger.java index 077dc567dc..15f8be7ac0 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ServerCoreDebugger.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/ServerCoreDebugger.java @@ -25,7 +25,7 @@ import java.util.List; import java.util.Map; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.http.HttpHeader; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/ContentNegotiatorTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/ContentNegotiatorTest.java index 167fa7ea51..3e34c21086 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/ContentNegotiatorTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/ContentNegotiatorTest.java @@ -19,8 +19,7 @@ package org.apache.olingo.server.core; import static org.junit.Assert.*; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyListOf; +import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -35,6 +34,7 @@ import org.apache.olingo.server.api.serializer.RepresentationType; import org.apache.olingo.server.api.uri.queryoption.FormatOption; import org.junit.Test; +import org.mockito.ArgumentMatchers; public class ContentNegotiatorTest { @@ -297,7 +297,7 @@ private CustomContentTypeSupport createCustomContentTypeSupport(final String con CustomContentTypeSupport customContentTypeSupport = mock(CustomContentTypeSupport.class); when(customContentTypeSupport.modifySupportedContentTypes( - anyListOf(ContentType.class), any(RepresentationType.class))) + ArgumentMatchers.anyList(), any(RepresentationType.class))) .thenReturn(types); return customContentTypeSupport; } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataHttpHandlerImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataHttpHandlerImplTest.java index 158cae6206..02a5df0410 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataHttpHandlerImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/ODataHttpHandlerImplTest.java @@ -23,7 +23,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.apache.olingo.commons.api.http.HttpMethod; import org.apache.olingo.server.api.ODataLibraryException; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java index 6347048add..95325e6f19 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/batchhandler/MockedBatchHandlerTest.java @@ -84,65 +84,65 @@ public void setup() { @Test public void test() throws Exception { final String content = "--batch_12345" + CRLF - + "Content-Type: multipart/mixed; boundary=changeset_12345" + CRLF - + CRLF - + "--changeset_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 3" + CRLF - + CRLF - + "PUT ESAllPrim(1) HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 4" + CRLF - + CRLF - + "PUT $3/PropertyInt32 HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 1" + CRLF - + CRLF - + "POST ESAllPrim HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 5" + CRLF - + CRLF - + "POST http://localhost:8080/odata/$1/NavPropertyETTwoPrimMany HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 2" + CRLF - + CRLF - + "POST $1/NavPropertyETTwoPrimMany HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 6" + CRLF - + CRLF - + "PUT ESAllPrim(1) HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_12345--" + CRLF - + CRLF - + "--batch_12345--"; + + "Content-Type: multipart/mixed; boundary=changeset_12345" + CRLF + + CRLF + + "--changeset_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 3" + CRLF + + CRLF + + "PUT ESAllPrim(1) HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 4" + CRLF + + CRLF + + "PUT $3/PropertyInt32 HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 1" + CRLF + + CRLF + + "POST ESAllPrim HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 5" + CRLF + + CRLF + + "POST http://localhost:8080/odata/$1/NavPropertyETTwoPrimMany HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 2" + CRLF + + CRLF + + "POST $1/NavPropertyETTwoPrimMany HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 6" + CRLF + + CRLF + + "PUT ESAllPrim(1) HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_12345--" + CRLF + + CRLF + + "--batch_12345--"; final Map> header = getMimeHeader(); final ODataResponse response = new ODataResponse(); final ODataRequest request = buildODataRequest(content, header); @@ -150,7 +150,7 @@ public void test() throws Exception { batchHandler.process(request, response, true); BatchLineReader reader = - new BatchLineReader(response.getContent()); + new BatchLineReader(response.getContent()); final List responseContent = reader.toList(); reader.close(); @@ -205,14 +205,14 @@ public void test() throws Exception { @Test public void testGetRequest() throws Exception { final String content = "" - + "--batch_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + CRLF - + "GET ESAllPrim(0) HTTP/1.1" + CRLF - + CRLF - + CRLF - + "--batch_12345--"; + + "--batch_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + CRLF + + "GET ESAllPrim(0) HTTP/1.1" + CRLF + + CRLF + + CRLF + + "--batch_12345--"; final Map> header = getMimeHeader(); final ODataResponse response = new ODataResponse(); @@ -221,7 +221,7 @@ public void testGetRequest() throws Exception { batchHandler.process(request, response, true); BatchLineReader reader = - new BatchLineReader(response.getContent()); + new BatchLineReader(response.getContent()); final List responseContent = reader.toList(); int line = 0; @@ -245,54 +245,54 @@ public void testGetRequest() throws Exception { @Test public void testMultipleChangeSets() throws Exception { final String content = "" - + "--batch_12345" + CRLF - + "Content-Type: multipart/mixed; boundary=changeset_12345" + CRLF - + CRLF - + "--changeset_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 1" + CRLF - + CRLF - + "PUT ESAllPrim(1) HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 2" + CRLF - + CRLF - + "POST $1/NavPropertyETTwoPrimMany HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_12345--" + CRLF - - + "--batch_12345" + CRLF - + "Content-Type: multipart/mixed; boundary=changeset_54321" + CRLF - + CRLF - + "--changeset_54321" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 1" + CRLF - + CRLF - + "PUT http://localhost:8080/odata/ESAllPrim(2) HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_54321" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 2" + CRLF - + CRLF - + "POST $1/NavPropertyETTwoPrimMany HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_54321--" + CRLF - - + CRLF - + "--batch_12345--"; + + "--batch_12345" + CRLF + + "Content-Type: multipart/mixed; boundary=changeset_12345" + CRLF + + CRLF + + "--changeset_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 1" + CRLF + + CRLF + + "PUT ESAllPrim(1) HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 2" + CRLF + + CRLF + + "POST $1/NavPropertyETTwoPrimMany HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_12345--" + CRLF + + + "--batch_12345" + CRLF + + "Content-Type: multipart/mixed; boundary=changeset_54321" + CRLF + + CRLF + + "--changeset_54321" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 1" + CRLF + + CRLF + + "PUT http://localhost:8080/odata/ESAllPrim(2) HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_54321" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 2" + CRLF + + CRLF + + "POST $1/NavPropertyETTwoPrimMany HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_54321--" + CRLF + + + CRLF + + "--batch_12345--"; final Map> header = getMimeHeader(); final ODataResponse response = new ODataResponse(); final ODataRequest request = buildODataRequest(content, header); @@ -300,7 +300,7 @@ public void testMultipleChangeSets() throws Exception { batchHandler.process(request, response, true); BatchLineReader reader = - new BatchLineReader(response.getContent()); + new BatchLineReader(response.getContent()); final List responseContent = reader.toList(); reader.close(); @@ -367,49 +367,49 @@ public void testMultipleChangeSets() throws Exception { @Test public void mimeBodyPartTransitive() throws Exception { final String content = "" - + "--batch_12345" + CRLF - + "Content-Type: multipart/mixed; boundary=changeset_12345" + CRLF - + CRLF - + "--changeset_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 1" + CRLF - + CRLF - + "PUT ESAllPrim(1) HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 2" + CRLF - + CRLF - + "POST $1/NavPropertyETTwoPrimMany HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 3" + CRLF - + CRLF - + "POST $2/NavPropertyETAllPrimMany HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 4" + CRLF - + CRLF - + "POST $3/NavPropertyETTwoPrimOne HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_12345--" + CRLF - - + CRLF - + "--batch_12345--"; + + "--batch_12345" + CRLF + + "Content-Type: multipart/mixed; boundary=changeset_12345" + CRLF + + CRLF + + "--changeset_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 1" + CRLF + + CRLF + + "PUT ESAllPrim(1) HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 2" + CRLF + + CRLF + + "POST $1/NavPropertyETTwoPrimMany HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 3" + CRLF + + CRLF + + "POST $2/NavPropertyETAllPrimMany HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 4" + CRLF + + CRLF + + "POST $3/NavPropertyETTwoPrimOne HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_12345--" + CRLF + + + CRLF + + "--batch_12345--"; final Map> header = getMimeHeader(); final ODataResponse response = new ODataResponse(); @@ -418,7 +418,7 @@ public void mimeBodyPartTransitive() throws Exception { batchHandler.process(request, response, true); BatchLineReader reader = - new BatchLineReader(response.getContent()); + new BatchLineReader(response.getContent()); final List responseContent = reader.toList(); reader.close(); @@ -468,21 +468,21 @@ public void mimeBodyPartTransitive() throws Exception { @Test(expected = BatchDeserializerException.class) public void testInvalidMethod() throws Exception { final String content = "" - + "--batch_12345" + CRLF - + "Content-Type: multipart/mixed; boundary=changeset_12345" + CRLF - + CRLF - + "--changeset_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 1" + CRLF - + CRLF - + "PUT ESAllPrim(1) HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_12345--" + CRLF - + CRLF - + "--batch_12345--"; + + "--batch_12345" + CRLF + + "Content-Type: multipart/mixed; boundary=changeset_12345" + CRLF + + CRLF + + "--changeset_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 1" + CRLF + + CRLF + + "PUT ESAllPrim(1) HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_12345--" + CRLF + + CRLF + + "--batch_12345--"; final Map> header = getMimeHeader(); final ODataResponse response = new ODataResponse(); @@ -495,21 +495,21 @@ public void testInvalidMethod() throws Exception { @Test(expected = BatchDeserializerException.class) public void testInvalidContentType() throws Exception { final String content = "" - + "--batch_12345" + CRLF - + "Content-Type: multipart/mixed; boundary=changeset_12345" + CRLF - + CRLF - + "--changeset_12345" + CRLF - + "Content-Type: application/http" + CRLF - + "Content-Transfer-Encoding: binary" + CRLF - + "Content-Id: 1" + CRLF - + CRLF - + "PUT ESAllPrim(1) HTTP/1.1" + CRLF - + "Content-Type: application/json;odata=verbose" + CRLF - + CRLF - + CRLF - + "--changeset_12345--" + CRLF - + CRLF - + "--batch_12345--"; + + "--batch_12345" + CRLF + + "Content-Type: multipart/mixed; boundary=changeset_12345" + CRLF + + CRLF + + "--changeset_12345" + CRLF + + "Content-Type: application/http" + CRLF + + "Content-Transfer-Encoding: binary" + CRLF + + "Content-Id: 1" + CRLF + + CRLF + + "PUT ESAllPrim(1) HTTP/1.1" + CRLF + + "Content-Type: application/json;odata=verbose" + CRLF + + CRLF + + CRLF + + "--changeset_12345--" + CRLF + + CRLF + + "--batch_12345--"; final Map> header = new HashMap>(); header.put(HttpHeader.CONTENT_TYPE, Arrays.asList(new String[] { "application/http" })); @@ -543,7 +543,7 @@ private Map> getMimeHeader() { } private ODataRequest buildODataRequest(final String content, final Map> header) - throws Exception { + throws Exception { final ODataRequest request = new ODataRequest(); for (final String key : header.keySet()) { @@ -591,11 +591,11 @@ public ODataResponsePart processChangeSet(final BatchFacade facade, final List parts = - odata.createFixedFormatDeserializer().parseBatchRequest(request.getBody(), boundary, options); + odata.createFixedFormatDeserializer().parseBatchRequest(request.getBody(), boundary, options); final List responseParts = new ArrayList(); for (BatchRequestPart part : parts) { @@ -616,7 +616,7 @@ public ODataResponse answer(final InvocationOnMock invocation) throws Throwable final String responeBoundary = "batch_" + UUID.randomUUID().toString(); final InputStream responseStream = - odata.createFixedFormatSerializer().batchResponse(responseParts, responeBoundary); + odata.createFixedFormatSerializer().batchResponse(responseParts, responeBoundary); response.setStatusCode(HttpStatusCode.ACCEPTED.getStatusCode()); response.setHeader(HttpHeader.CONTENT_TYPE, ContentType.MULTIPART_MIXED + ";boundary=" + responeBoundary); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java index 977206118d..f82e1d68e2 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java @@ -23,14 +23,14 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.io.IOException; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.apache.commons.io.IOUtils; import org.apache.olingo.commons.api.ex.ODataRuntimeException; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestParserTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestParserTest.java index 1c218ad876..2e98234dea 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestParserTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/batch/BatchRequestParserTest.java @@ -1178,7 +1178,7 @@ private void parseInvalidBatchBody(final String batch, final MessageKeys key) { } private InputStream readFile(final String fileName) throws IOException { - final InputStream in = ClassLoader.class.getResourceAsStream(fileName); + final InputStream in = BatchRequestParserTest.class.getResourceAsStream(fileName); if (in == null) { throw new IOException("Requested file '" + fileName + "' was not found."); } diff --git a/lib/server-tecsvc/pom.xml b/lib/server-tecsvc/pom.xml index d4a4082b04..58eef92d46 100644 --- a/lib/server-tecsvc/pom.xml +++ b/lib/server-tecsvc/pom.xml @@ -117,11 +117,16 @@ - javax.servlet - servlet-api - 2.5 + jakarta.servlet + jakarta.servlet-api + ${jakarta.servlet.version} provided + + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.version} + org.apache.olingo @@ -163,7 +168,7 @@ org.mockito - mockito-all + mockito-core commons-io diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServlet.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServlet.java index eee52e900f..fa3f849965 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServlet.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServlet.java @@ -23,11 +23,11 @@ import java.util.Collections; import java.util.UUID; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import org.apache.olingo.commons.api.edmx.EdmxReference; import org.apache.olingo.commons.api.edmx.EdmxReferenceInclude; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServletContextListener.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServletContextListener.java index 71aef570be..66decb1396 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServletContextListener.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServletContextListener.java @@ -18,8 +18,8 @@ */ package org.apache.olingo.server.tecsvc; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; import org.apache.olingo.server.tecsvc.async.TechnicalAsyncService; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/TechnicalAsyncService.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/TechnicalAsyncService.java index c31f202402..19a0f85332 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/TechnicalAsyncService.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/TechnicalAsyncService.java @@ -31,8 +31,8 @@ import org.apache.olingo.server.api.processor.Processor; import org.apache.olingo.server.api.serializer.SerializerException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.Closeable; import java.io.IOException; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/TechnicalStatusMonitorServlet.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/TechnicalStatusMonitorServlet.java index 6ed37226b9..ae6f352272 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/TechnicalStatusMonitorServlet.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/TechnicalStatusMonitorServlet.java @@ -21,10 +21,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; public class TechnicalStatusMonitorServlet extends HttpServlet { diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/queryoptions/options/SearchHandler.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/queryoptions/options/SearchHandler.java index 1379b9749e..130ca1e1cf 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/queryoptions/options/SearchHandler.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/queryoptions/options/SearchHandler.java @@ -23,7 +23,7 @@ import java.util.ListIterator; import java.util.Locale; -import javax.xml.bind.DatatypeConverter; +import jakarta.xml.bind.DatatypeConverter; import org.apache.olingo.commons.api.data.Entity; import org.apache.olingo.commons.api.data.EntityCollection; diff --git a/lib/server-test/pom.xml b/lib/server-test/pom.xml index 9e953865a7..6d04fb9f70 100644 --- a/lib/server-test/pom.xml +++ b/lib/server-test/pom.xml @@ -56,7 +56,7 @@ org.mockito - mockito-all + mockito-core commons-io diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerImplTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerImplTest.java index e0fcc71469..a4d8a60740 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerImplTest.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerImplTest.java @@ -24,12 +24,12 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions;; import java.io.ByteArrayInputStream; import java.io.InputStream; @@ -791,19 +791,19 @@ public void dispatchValueOnNoMedia() throws Exception { final MediaEntityProcessor processor = mock(MediaEntityProcessor.class); dispatch(HttpMethod.GET, uri, processor); - verifyZeroInteractions(processor); + verifyNoInteractions(processor); dispatch(HttpMethod.POST, uri, processor); - verifyZeroInteractions(processor); + verifyNoInteractions(processor); dispatch(HttpMethod.PUT, uri, processor); - verifyZeroInteractions(processor); + verifyNoInteractions(processor); dispatch(HttpMethod.DELETE, uri, processor); - verifyZeroInteractions(processor); + verifyNoInteractions(processor); dispatch(HttpMethod.HEAD, uri, processor); - verifyZeroInteractions(processor); + verifyNoInteractions(processor); } @Test @@ -1108,7 +1108,7 @@ public void illegalRequestContentType() throws Exception { EntityProcessor processor = mock(EntityProcessor.class); final ODataResponse response = dispatch(HttpMethod.POST, "ESAllPrim", null, HttpHeader.CONTENT_TYPE, "*/*", processor); - verifyZeroInteractions(processor); + verifyNoInteractions(processor); assertEquals(HttpStatusCode.BAD_REQUEST.getStatusCode(), response.getStatusCode()); } @@ -1117,7 +1117,7 @@ public void unsupportedRequestContentType() throws Exception { EntityProcessor processor = mock(EntityProcessor.class); ErrorProcessor errorProcessor = mock(ErrorProcessor.class); dispatch(HttpMethod.POST, "ESAllPrim", null, HttpHeader.CONTENT_TYPE, "some/unsupported", errorProcessor); - verifyZeroInteractions(processor); + verifyNoInteractions(processor); verify(errorProcessor).processError(any(ODataRequest.class), any(ODataResponse.class), any(ODataServerError.class), any(ContentType.class)); diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/PreconditionsValidatorTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/PreconditionsValidatorTest.java index 154e529fc2..e9f163cbfb 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/PreconditionsValidatorTest.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/PreconditionsValidatorTest.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/ParserTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/ParserTest.java index 1eaa7ffde1..e67040214f 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/ParserTest.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/ParserTest.java @@ -180,7 +180,7 @@ public void expandNavigationPropertyWithSameNameAsEntitySet() throws Exception { .goPath().first() .isNavProperty("Products", nameProducts, false) .isType(nameProducts, false); - Mockito.verifyZeroInteractions(esProduct); + Mockito.verifyNoInteractions(esProduct); } /** diff --git a/pom.xml b/pom.xml index e268635254..d97e6ab1d6 100644 --- a/pom.xml +++ b/pom.xml @@ -80,8 +80,7 @@ 2.0 4.4 3.1.0 - 3.0.16 - 4.0.9.RELEASE + 4.0.1 4.1.84.Final 1.7 @@ -94,7 +93,7 @@ 2.14.0 1.3.1 1.6 - 1.10.19 + 5.3.1 4.13.2 4.1.1.4 @@ -103,7 +102,7 @@ 1.7.36 9080 - 7.0.109 + 10.0.27 4.2.0 @@ -115,6 +114,14 @@ 8 ${maven.build.timestamp} true + 2.0.1 + 3.1.0 + 6.0.0 + 2.1.1 + 4.0.0 + 6.0.9 + 1.1 + 1.0.1 -Xdoclint:none @@ -181,8 +188,8 @@ ${jackson.version} - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider ${jackson.version} @@ -220,14 +227,14 @@ ${esigate.version} - javax.servlet - javax.servlet-api - ${servlet.version} + jakarta.servlet + jakarta.servlet-api + ${jakarta.servlet.version} - org.apache.geronimo.specs - geronimo-javamail_1.4_spec - 1.7.1 + org.apache.geronimo.javamail + geronimo-javamail_1.6_mail + ${geronimo.version} org.apache.cxf @@ -255,11 +262,6 @@ tomcat-embed-core ${tomcat.version} - - org.apache.tomcat.embed - tomcat-embed-logging-log4j - ${tomcat.version} - org.apache.tomcat tomcat-jasper @@ -292,8 +294,8 @@ org.mockito - mockito-all - ${mockito-all.version} + mockito-core + ${mockito.core.version} test diff --git a/samples/server/pom.xml b/samples/server/pom.xml index 7f0a1dc1e5..9067eaafac 100644 --- a/samples/server/pom.xml +++ b/samples/server/pom.xml @@ -52,9 +52,9 @@ - javax.servlet - servlet-api - 2.5 + jakarta.servlet + jakarta.servlet-api + ${jakarta.servlet.version} provided diff --git a/samples/server/src/main/java/org/apache/olingo/server/sample/CarsServlet.java b/samples/server/src/main/java/org/apache/olingo/server/sample/CarsServlet.java index 7812f6a15a..7902787bea 100644 --- a/samples/server/src/main/java/org/apache/olingo/server/sample/CarsServlet.java +++ b/samples/server/src/main/java/org/apache/olingo/server/sample/CarsServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import org.apache.olingo.commons.api.edmx.EdmxReference; import org.apache.olingo.server.api.OData; diff --git a/samples/tutorials/p0_all/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java b/samples/tutorials/p0_all/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java index 68a11353e1..5cc3f756c6 100644 --- a/samples/tutorials/p0_all/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java +++ b/samples/tutorials/p0_all/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java @@ -241,7 +241,7 @@ private void validateNestedExpxandSystemQueryOptions(final ExpandOption expandOp * Example request: * * POST URL: http://localhost:8080/DemoService/DemoService.svc/Products - * Header: Content-Type: application/json; odata.metadata=minimal + * Header: Content-Type: application/json;odata.metadata=minimal * Request body: * { * "ID":3, diff --git a/samples/tutorials/p0_all/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p0_all/src/main/java/myservice/mynamespace/web/DemoServlet.java index c390a755e1..2f016717e1 100644 --- a/samples/tutorials/p0_all/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p0_all/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.lang.Override;import java.lang.RuntimeException;import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import myservice.mynamespace.data.Storage; import myservice.mynamespace.service.DemoActionProcessor; diff --git a/samples/tutorials/p10_media/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java b/samples/tutorials/p10_media/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java index cd2a875cc2..5c90792c1f 100644 --- a/samples/tutorials/p10_media/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java +++ b/samples/tutorials/p10_media/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java @@ -158,7 +158,7 @@ public void readEntity(ODataRequest request, ODataResponse response, UriInfo uri * Example request: * * POST URL: http://localhost:8080/DemoService/DemoService.svc/Products - * Header: Content-Type: application/json; odata.metadata=minimal + * Header: Content-Type: application/json;odata.metadata=minimal * Request body: { "ID":3, diff --git a/samples/tutorials/p10_media/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p10_media/src/main/java/myservice/mynamespace/web/DemoServlet.java index 122d9cf366..8bc2f26314 100644 --- a/samples/tutorials/p10_media/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p10_media/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import org.apache.olingo.server.api.OData; import org.apache.olingo.server.api.ODataHttpHandler; diff --git a/samples/tutorials/p11_batch/pom.xml b/samples/tutorials/p11_batch/pom.xml index 277a3e7cee..6e4fcbe344 100644 --- a/samples/tutorials/p11_batch/pom.xml +++ b/samples/tutorials/p11_batch/pom.xml @@ -33,7 +33,7 @@ 2.5 4.10.0-SNAPSHOT 1.7.7 - 1.6 + 17 3.2 UTF-8 diff --git a/samples/tutorials/p11_batch/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java b/samples/tutorials/p11_batch/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java index 4624ee69e2..3550429a28 100644 --- a/samples/tutorials/p11_batch/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java +++ b/samples/tutorials/p11_batch/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java @@ -99,7 +99,7 @@ public void readEntity(ODataRequest request, ODataResponse response, UriInfo uri * Example request: * * POST URL: http://localhost:8080/DemoService/DemoService.svc/Products - * Header: Content-Type: application/json; odata.metadata=minimal + * Header: Content-Type: application/json;odata.metadata=minimal * Request body: { "ID":3, diff --git a/samples/tutorials/p11_batch/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p11_batch/src/main/java/myservice/mynamespace/web/DemoServlet.java index d3b4a481e7..fc801b22c2 100644 --- a/samples/tutorials/p11_batch/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p11_batch/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.lang.Override;import java.lang.RuntimeException;import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import myservice.mynamespace.data.Storage; import myservice.mynamespace.service.DemoBatchProcessor; diff --git a/samples/tutorials/p12_deep_insert/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java b/samples/tutorials/p12_deep_insert/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java index fde3ece5c1..920d92426c 100644 --- a/samples/tutorials/p12_deep_insert/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java +++ b/samples/tutorials/p12_deep_insert/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java @@ -147,7 +147,7 @@ public void readEntity(ODataRequest request, ODataResponse response, UriInfo uri * Example request: * * POST URL: http://localhost:8080/DemoService/DemoService.svc/Products - * Header: Content-Type: application/json; odata.metadata=minimal + * Header: Content-Type: application/json;odata.metadata=minimal * Request body: { "ID":3, diff --git a/samples/tutorials/p12_deep_insert/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p12_deep_insert/src/main/java/myservice/mynamespace/web/DemoServlet.java index 2cd85773e5..0d9136009d 100644 --- a/samples/tutorials/p12_deep_insert/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p12_deep_insert/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import org.apache.olingo.server.api.OData; import org.apache.olingo.server.api.ODataHttpHandler; diff --git a/samples/tutorials/p12_deep_insert_preparation/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java b/samples/tutorials/p12_deep_insert_preparation/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java index fde3ece5c1..920d92426c 100644 --- a/samples/tutorials/p12_deep_insert_preparation/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java +++ b/samples/tutorials/p12_deep_insert_preparation/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java @@ -147,7 +147,7 @@ public void readEntity(ODataRequest request, ODataResponse response, UriInfo uri * Example request: * * POST URL: http://localhost:8080/DemoService/DemoService.svc/Products - * Header: Content-Type: application/json; odata.metadata=minimal + * Header: Content-Type: application/json;odata.metadata=minimal * Request body: { "ID":3, diff --git a/samples/tutorials/p12_deep_insert_preparation/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p12_deep_insert_preparation/src/main/java/myservice/mynamespace/web/DemoServlet.java index 2cd85773e5..0d9136009d 100644 --- a/samples/tutorials/p12_deep_insert_preparation/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p12_deep_insert_preparation/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import org.apache.olingo.server.api.OData; import org.apache.olingo.server.api.ODataHttpHandler; diff --git a/samples/tutorials/p1_read/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p1_read/src/main/java/myservice/mynamespace/web/DemoServlet.java index c9d3f7f000..4faa37d912 100755 --- a/samples/tutorials/p1_read/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p1_read/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,10 +21,10 @@ import java.io.IOException; import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import myservice.mynamespace.service.DemoEdmProvider; import myservice.mynamespace.service.DemoEntityCollectionProcessor; diff --git a/samples/tutorials/p2_readep/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p2_readep/src/main/java/myservice/mynamespace/web/DemoServlet.java index 1758cf485c..3e3fc61c3e 100755 --- a/samples/tutorials/p2_readep/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p2_readep/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.lang.Override;import java.lang.RuntimeException;import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import myservice.mynamespace.data.Storage; import myservice.mynamespace.service.DemoEdmProvider; diff --git a/samples/tutorials/p3_write/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java b/samples/tutorials/p3_write/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java index 499f5f616d..b86aa22f43 100755 --- a/samples/tutorials/p3_write/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java +++ b/samples/tutorials/p3_write/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java @@ -99,7 +99,7 @@ public void readEntity(ODataRequest request, ODataResponse response, UriInfo uri * Example request: * * POST URL: http://localhost:8080/DemoService/DemoService.svc/Products - * Header: Content-Type: application/json; odata.metadata=minimal + * Header: Content-Type: application/json;odata.metadata=minimal * Request body: { "ID":3, diff --git a/samples/tutorials/p3_write/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p3_write/src/main/java/myservice/mynamespace/web/DemoServlet.java index dd481d3958..8a505b0b62 100755 --- a/samples/tutorials/p3_write/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p3_write/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.lang.Override;import java.lang.RuntimeException;import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import myservice.mynamespace.data.Storage; import myservice.mynamespace.service.DemoEdmProvider; diff --git a/samples/tutorials/p4_navigation/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p4_navigation/src/main/java/myservice/mynamespace/web/DemoServlet.java index 43623f3e1b..d273e95659 100755 --- a/samples/tutorials/p4_navigation/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p4_navigation/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import myservice.mynamespace.data.Storage; import myservice.mynamespace.service.DemoEdmProvider; diff --git a/samples/tutorials/p5_queryoptions-tcs/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p5_queryoptions-tcs/src/main/java/myservice/mynamespace/web/DemoServlet.java index 1758cf485c..3e3fc61c3e 100755 --- a/samples/tutorials/p5_queryoptions-tcs/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p5_queryoptions-tcs/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.lang.Override;import java.lang.RuntimeException;import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import myservice.mynamespace.data.Storage; import myservice.mynamespace.service.DemoEdmProvider; diff --git a/samples/tutorials/p6_queryoptions-es/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p6_queryoptions-es/src/main/java/myservice/mynamespace/web/DemoServlet.java index 43623f3e1b..d273e95659 100755 --- a/samples/tutorials/p6_queryoptions-es/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p6_queryoptions-es/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import myservice.mynamespace.data.Storage; import myservice.mynamespace.service.DemoEdmProvider; diff --git a/samples/tutorials/p7_queryoptions-o/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p7_queryoptions-o/src/main/java/myservice/mynamespace/web/DemoServlet.java index 1758cf485c..3e3fc61c3e 100644 --- a/samples/tutorials/p7_queryoptions-o/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p7_queryoptions-o/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.lang.Override;import java.lang.RuntimeException;import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import myservice.mynamespace.data.Storage; import myservice.mynamespace.service.DemoEdmProvider; diff --git a/samples/tutorials/p8_queryoptions-f/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p8_queryoptions-f/src/main/java/myservice/mynamespace/web/DemoServlet.java index 1758cf485c..3e3fc61c3e 100644 --- a/samples/tutorials/p8_queryoptions-f/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p8_queryoptions-f/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.lang.Override;import java.lang.RuntimeException;import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import myservice.mynamespace.data.Storage; import myservice.mynamespace.service.DemoEdmProvider; diff --git a/samples/tutorials/p9_action/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java b/samples/tutorials/p9_action/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java index 54af25833d..c4bc711d30 100644 --- a/samples/tutorials/p9_action/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java +++ b/samples/tutorials/p9_action/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java @@ -234,7 +234,7 @@ private void readEntityInternal(ODataRequest request, ODataResponse response, Ur * Example request: * * POST URL: http://localhost:8080/DemoService/DemoService.svc/Products - * Header: Content-Type: application/json; odata.metadata=minimal + * Header: Content-Type: application/json;odata.metadata=minimal * Request body: { "ID":3, diff --git a/samples/tutorials/p9_action/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p9_action/src/main/java/myservice/mynamespace/web/DemoServlet.java index f9b0d3afc4..2a40dfe141 100644 --- a/samples/tutorials/p9_action/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p9_action/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.lang.Override;import java.lang.RuntimeException;import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import myservice.mynamespace.data.Storage; import myservice.mynamespace.service.DemoActionProcessor; diff --git a/samples/tutorials/p9_action_preparation/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java b/samples/tutorials/p9_action_preparation/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java index 92439091ef..073d6d2e21 100644 --- a/samples/tutorials/p9_action_preparation/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java +++ b/samples/tutorials/p9_action_preparation/src/main/java/myservice/mynamespace/service/DemoEntityProcessor.java @@ -158,7 +158,7 @@ public void readEntity(ODataRequest request, ODataResponse response, UriInfo uri * Example request: * * POST URL: http://localhost:8080/DemoService/DemoService.svc/Products - * Header: Content-Type: application/json; odata.metadata=minimal + * Header: Content-Type: application/json;odata.metadata=minimal * Request body: { "ID":3, diff --git a/samples/tutorials/p9_action_preparation/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/p9_action_preparation/src/main/java/myservice/mynamespace/web/DemoServlet.java index 122d9cf366..8bc2f26314 100644 --- a/samples/tutorials/p9_action_preparation/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/p9_action_preparation/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import org.apache.olingo.server.api.OData; import org.apache.olingo.server.api.ODataHttpHandler; diff --git a/samples/tutorials/pe_streaming/src/main/java/myservice/mynamespace/web/DemoServlet.java b/samples/tutorials/pe_streaming/src/main/java/myservice/mynamespace/web/DemoServlet.java index 1758cf485c..3e3fc61c3e 100755 --- a/samples/tutorials/pe_streaming/src/main/java/myservice/mynamespace/web/DemoServlet.java +++ b/samples/tutorials/pe_streaming/src/main/java/myservice/mynamespace/web/DemoServlet.java @@ -21,11 +21,11 @@ import java.io.IOException; import java.lang.Override;import java.lang.RuntimeException;import java.util.ArrayList; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import myservice.mynamespace.data.Storage; import myservice.mynamespace.service.DemoEdmProvider;