diff --git a/src/JavaCodeGenerator.cs b/src/JavaCodeGenerator.cs index 4986928294..63637830ff 100644 --- a/src/JavaCodeGenerator.cs +++ b/src/JavaCodeGenerator.cs @@ -91,7 +91,7 @@ public class JavaCodeGenerator : CodeGenerator "byte[]", "Byte[]", "String", "LocalDate", - "DateTime", + "OffsetDateTime", "DateTimeRfc1123", "Duration", "Period", @@ -1427,10 +1427,10 @@ private static IType ParseType(AutoRestIModelType autoRestIModelType, JavaSettin result = ArrayType.ByteArray; break; case AutoRestKnownPrimaryType.Date: - result = ClassType.JodaLocalDate; + result = ClassType.LocalDate; break; case AutoRestKnownPrimaryType.DateTime: - result = ClassType.JodaDateTime; + result = ClassType.DateTime; break; case AutoRestKnownPrimaryType.DateTimeRfc1123: result = ClassType.DateTimeRfc1123; @@ -1461,7 +1461,7 @@ private static IType ParseType(AutoRestIModelType autoRestIModelType, JavaSettin } break; case AutoRestKnownPrimaryType.TimeSpan: - result = ClassType.JodaPeriod; + result = ClassType.Duration; break; case AutoRestKnownPrimaryType.UnixTime: result = PrimitiveType.UnixTimeLong; @@ -2683,7 +2683,7 @@ public static JavaFile GetModelJavaFile(ServiceModel model, JavaSettings setting string propertyConversion = null; switch (sourceTypeName.ToLower()) { - case "datetime": + case "offsetdatetime": switch (targetTypeName.ToLower()) { case "datetimerfc1123": @@ -2695,7 +2695,7 @@ public static JavaFile GetModelJavaFile(ServiceModel model, JavaSettings setting case "datetimerfc1123": switch (targetTypeName.ToLower()) { - case "datetime": + case "offsetdatetime": propertyConversion = $"{expression}.dateTime()"; break; } @@ -2741,7 +2741,7 @@ public static JavaFile GetModelJavaFile(ServiceModel model, JavaSettings setting { switch (sourceTypeName.ToLower()) { - case "datetime": + case "offsetdatetime": switch (targetTypeName.ToLower()) { case "datetimerfc1123": @@ -2753,7 +2753,7 @@ public static JavaFile GetModelJavaFile(ServiceModel model, JavaSettings setting case "datetimerfc1123": switch (targetTypeName.ToLower()) { - case "datetime": + case "offsetdatetime": propertyConversion = $"{expression}.dateTime()"; break; } @@ -3031,7 +3031,7 @@ private static IType ConvertToClientType(IType modelType) } else if (modelType == ClassType.DateTimeRfc1123) { - clientType = ClassType.JodaDateTime; + clientType = ClassType.DateTime; } else if (modelType == PrimitiveType.UnixTimeLong) { @@ -3179,7 +3179,7 @@ private static string AutoRestIModelTypeName(AutoRestIModelType autoRestModelTyp result = "LocalDate"; break; case AutoRestKnownPrimaryType.DateTime: - result = "DateTime"; + result = "OffsetDateTime"; break; case AutoRestKnownPrimaryType.DateTimeRfc1123: result = "DateTimeRfc1123"; @@ -3302,14 +3302,14 @@ private static void ParameterConvertClientTypeToWireType(JavaBlock block, JavaSe { if (parameterIsRequired) { - block.Line($"Long {target} = {source}.toDateTime(DateTimeZone.UTC).getMillis() / 1000;"); + block.Line($"Long {target} = {source}.toInstant().getEpochSecond();"); } else { block.Line($"Long {target} = null;"); block.If($"{source} != null", ifBlock => { - ifBlock.Line($"{target} = {source}.toDateTime(DateTimeZone.UTC).getMillis() / 1000;"); + ifBlock.Line($"{target} = {source}.toInstant().getEpochSecond();"); }); } } @@ -4596,10 +4596,10 @@ private static IEnumerable GetExpressionsToValidate(RestAPIMethod restAP parameterType != ClassType.Double && parameterType != ClassType.BigDecimal && parameterType != ClassType.String && - parameterType != ClassType.JodaDateTime && - parameterType != ClassType.JodaLocalDate && + parameterType != ClassType.DateTime && + parameterType != ClassType.LocalDate && parameterType != ClassType.DateTimeRfc1123 && - parameterType != ClassType.JodaPeriod && + parameterType != ClassType.Duration && parameterType != ClassType.Boolean && parameterType != ClassType.ServiceClientCredentials && parameterType != ClassType.AzureTokenCredentials && diff --git a/src/Model/ClassType.cs b/src/Model/ClassType.cs index b7c60c9296..6e1a903e89 100644 --- a/src/Model/ClassType.cs +++ b/src/Model/ClassType.cs @@ -17,10 +17,10 @@ public class ClassType : IType public static readonly ClassType Double = new ClassType("java.lang", "Double", defaultValueExpressionConverter: (string defaultValueExpression) => double.Parse(defaultValueExpression).ToString()); public static readonly ClassType String = new ClassType("java.lang", "String", defaultValueExpressionConverter: (string defaultValueExpression) => CodeNamer.Instance.QuoteValue(defaultValueExpression)); public static readonly ClassType Base64Url = new ClassType("com.microsoft.rest.v2", "Base64Url"); - public static readonly ClassType JodaLocalDate = new ClassType("org.joda.time", "LocalDate", defaultValueExpressionConverter: (string defaultValueExpression) => $"LocalDate.parse(\"{defaultValueExpression}\")"); - public static readonly ClassType JodaDateTime = new ClassType("org.joda.time", "DateTime", defaultValueExpressionConverter: (string defaultValueExpression) => $"DateTime.parse(\"{defaultValueExpression}\")"); - public static readonly ClassType JodaPeriod = new ClassType("org.joda.time", "Period", defaultValueExpressionConverter: (string defaultValueExpression) => $"Period.parse(\"{defaultValueExpression}\")"); - public static readonly ClassType DateTimeRfc1123 = new ClassType("com.microsoft.rest.v2", "DateTimeRfc1123", defaultValueExpressionConverter: (string defaultValueExpression) => $"DateTime.parse(\"{defaultValueExpression}\")"); + public static readonly ClassType LocalDate = new ClassType("java.time", "LocalDate", defaultValueExpressionConverter: (string defaultValueExpression) => $"LocalDate.parse(\"{defaultValueExpression}\")"); + public static readonly ClassType DateTime = new ClassType("java.time", "OffsetDateTime", defaultValueExpressionConverter: (string defaultValueExpression) => $"OffsetDateTime.parse(\"{defaultValueExpression}\")"); + public static readonly ClassType Duration = new ClassType("java.time", "Duration", defaultValueExpressionConverter: (string defaultValueExpression) => $"Duration.parse(\"{defaultValueExpression}\")"); + public static readonly ClassType DateTimeRfc1123 = new ClassType("com.microsoft.rest.v2", "DateTimeRfc1123", defaultValueExpressionConverter: (string defaultValueExpression) => $"new DateTimeRfc1123(\"{defaultValueExpression}\")"); public static readonly ClassType BigDecimal = new ClassType("java.math", "BigDecimal"); public static readonly ClassType UUID = new ClassType("java.util", "UUID"); public static readonly ClassType Object = new ClassType("java.lang", "Object"); @@ -29,7 +29,7 @@ public class ClassType : IType public static readonly ClassType CloudException = new ClassType("com.microsoft.azure.v2", "CloudException"); public static readonly ClassType RestException = new ClassType("com.microsoft.azure.v2", "RestException"); public static readonly ClassType UnixTime = new ClassType("com.microsoft.rest.v2", "UnixTime"); - public static readonly ClassType UnixTimeDateTime = new ClassType("org.joda.time", "DateTime", new[] { "org.joda.time.DateTimeZone" }); + public static readonly ClassType UnixTimeDateTime = new ClassType("java.time", "OffsetDateTime"); public static readonly ClassType UnixTimeLong = new ClassType("java.lang", "Long"); public static readonly ClassType AzureEnvironment = new ClassType("com.microsoft.azure.v2", "AzureEnvironment"); public static readonly ClassType HttpPipeline = new ClassType("com.microsoft.rest.v2.http", "HttpPipeline"); diff --git a/test/vanilla/src/main/java/fixtures/bodyarray/Arrays.java b/test/vanilla/src/main/java/fixtures/bodyarray/Arrays.java index 0db111dc0c..4bb8e36bf2 100644 --- a/test/vanilla/src/main/java/fixtures/bodyarray/Arrays.java +++ b/test/vanilla/src/main/java/fixtures/bodyarray/Arrays.java @@ -20,12 +20,12 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; +import java.time.Duration; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; import java.util.UUID; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.Period; /** * An instance of this class provides access to all the operations defined in @@ -1211,9 +1211,9 @@ public interface Arrays { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List<DateTime> object if successful. + * @return the List<OffsetDateTime> object if successful. */ - List getDateTimeValid(); + List getDateTimeValid(); /** * Get date-time array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. @@ -1222,68 +1222,68 @@ public interface Arrays { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture> getDateTimeValidAsync(ServiceCallback> serviceCallback); + ServiceFuture> getDateTimeValidAsync(ServiceCallback> serviceCallback); /** * Get date-time array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. * * @return a Single which performs the network request upon subscription. */ - Single>> getDateTimeValidWithRestResponseAsync(); + Single>> getDateTimeValidWithRestResponseAsync(); /** * Get date-time array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. * * @return a Single which performs the network request upon subscription. */ - Maybe> getDateTimeValidAsync(); + Maybe> getDateTimeValidAsync(); /** * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putDateTimeValid(@NonNull List arrayBody); + void putDateTimeValid(@NonNull List arrayBody); /** * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putDateTimeValidAsync(@NonNull List arrayBody, ServiceCallback serviceCallback); + ServiceFuture putDateTimeValidAsync(@NonNull List arrayBody, ServiceCallback serviceCallback); /** * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putDateTimeValidWithRestResponseAsync(@NonNull List arrayBody); + Single putDateTimeValidWithRestResponseAsync(@NonNull List arrayBody); /** * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putDateTimeValidAsync(@NonNull List arrayBody); + Completable putDateTimeValidAsync(@NonNull List arrayBody); /** * Get date array value ['2000-12-01t00:00:01z', null]. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List<DateTime> object if successful. + * @return the List<OffsetDateTime> object if successful. */ - List getDateTimeInvalidNull(); + List getDateTimeInvalidNull(); /** * Get date array value ['2000-12-01t00:00:01z', null]. @@ -1292,30 +1292,30 @@ public interface Arrays { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture> getDateTimeInvalidNullAsync(ServiceCallback> serviceCallback); + ServiceFuture> getDateTimeInvalidNullAsync(ServiceCallback> serviceCallback); /** * Get date array value ['2000-12-01t00:00:01z', null]. * * @return a Single which performs the network request upon subscription. */ - Single>> getDateTimeInvalidNullWithRestResponseAsync(); + Single>> getDateTimeInvalidNullWithRestResponseAsync(); /** * Get date array value ['2000-12-01t00:00:01z', null]. * * @return a Single which performs the network request upon subscription. */ - Maybe> getDateTimeInvalidNullAsync(); + Maybe> getDateTimeInvalidNullAsync(); /** * Get date array value ['2000-12-01t00:00:01z', 'date-time']. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List<DateTime> object if successful. + * @return the List<OffsetDateTime> object if successful. */ - List getDateTimeInvalidChars(); + List getDateTimeInvalidChars(); /** * Get date array value ['2000-12-01t00:00:01z', 'date-time']. @@ -1324,30 +1324,30 @@ public interface Arrays { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture> getDateTimeInvalidCharsAsync(ServiceCallback> serviceCallback); + ServiceFuture> getDateTimeInvalidCharsAsync(ServiceCallback> serviceCallback); /** * Get date array value ['2000-12-01t00:00:01z', 'date-time']. * * @return a Single which performs the network request upon subscription. */ - Single>> getDateTimeInvalidCharsWithRestResponseAsync(); + Single>> getDateTimeInvalidCharsWithRestResponseAsync(); /** * Get date array value ['2000-12-01t00:00:01z', 'date-time']. * * @return a Single which performs the network request upon subscription. */ - Maybe> getDateTimeInvalidCharsAsync(); + Maybe> getDateTimeInvalidCharsAsync(); /** * Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List<DateTime> object if successful. + * @return the List<OffsetDateTime> object if successful. */ - List getDateTimeRfc1123Valid(); + List getDateTimeRfc1123Valid(); /** * Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. @@ -1356,68 +1356,68 @@ public interface Arrays { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture> getDateTimeRfc1123ValidAsync(ServiceCallback> serviceCallback); + ServiceFuture> getDateTimeRfc1123ValidAsync(ServiceCallback> serviceCallback); /** * Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. * * @return a Single which performs the network request upon subscription. */ - Single>> getDateTimeRfc1123ValidWithRestResponseAsync(); + Single>> getDateTimeRfc1123ValidWithRestResponseAsync(); /** * Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. * * @return a Single which performs the network request upon subscription. */ - Maybe> getDateTimeRfc1123ValidAsync(); + Maybe> getDateTimeRfc1123ValidAsync(); /** * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putDateTimeRfc1123Valid(@NonNull List arrayBody); + void putDateTimeRfc1123Valid(@NonNull List arrayBody); /** * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putDateTimeRfc1123ValidAsync(@NonNull List arrayBody, ServiceCallback serviceCallback); + ServiceFuture putDateTimeRfc1123ValidAsync(@NonNull List arrayBody, ServiceCallback serviceCallback); /** * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putDateTimeRfc1123ValidWithRestResponseAsync(@NonNull List arrayBody); + Single putDateTimeRfc1123ValidWithRestResponseAsync(@NonNull List arrayBody); /** * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putDateTimeRfc1123ValidAsync(@NonNull List arrayBody); + Completable putDateTimeRfc1123ValidAsync(@NonNull List arrayBody); /** * Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List<Period> object if successful. + * @return the List<Duration> object if successful. */ - List getDurationValid(); + List getDurationValid(); /** * Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. @@ -1426,59 +1426,59 @@ public interface Arrays { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture> getDurationValidAsync(ServiceCallback> serviceCallback); + ServiceFuture> getDurationValidAsync(ServiceCallback> serviceCallback); /** * Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. * * @return a Single which performs the network request upon subscription. */ - Single>> getDurationValidWithRestResponseAsync(); + Single>> getDurationValidWithRestResponseAsync(); /** * Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. * * @return a Single which performs the network request upon subscription. */ - Maybe> getDurationValidAsync(); + Maybe> getDurationValidAsync(); /** * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. * - * @param arrayBody the List<Period> value. + * @param arrayBody the List<Duration> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putDurationValid(@NonNull List arrayBody); + void putDurationValid(@NonNull List arrayBody); /** * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. * - * @param arrayBody the List<Period> value. + * @param arrayBody the List<Duration> value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putDurationValidAsync(@NonNull List arrayBody, ServiceCallback serviceCallback); + ServiceFuture putDurationValidAsync(@NonNull List arrayBody, ServiceCallback serviceCallback); /** * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. * - * @param arrayBody the List<Period> value. + * @param arrayBody the List<Duration> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putDurationValidWithRestResponseAsync(@NonNull List arrayBody); + Single putDurationValidWithRestResponseAsync(@NonNull List arrayBody); /** * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. * - * @param arrayBody the List<Period> value. + * @param arrayBody the List<Duration> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putDurationValidAsync(@NonNull List arrayBody); + Completable putDurationValidAsync(@NonNull List arrayBody); /** * Get byte array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each item encoded in base64. diff --git a/test/vanilla/src/main/java/fixtures/bodyarray/implementation/ArraysImpl.java b/test/vanilla/src/main/java/fixtures/bodyarray/implementation/ArraysImpl.java index 4ae6e1e406..bd768de80d 100644 --- a/test/vanilla/src/main/java/fixtures/bodyarray/implementation/ArraysImpl.java +++ b/test/vanilla/src/main/java/fixtures/bodyarray/implementation/ArraysImpl.java @@ -32,14 +32,14 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; +import java.time.Duration; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.Period; /** * An instance of this class provides access to all the operations defined in @@ -250,28 +250,28 @@ private interface ArraysService { @GET("array/prim/date-time/valid") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single>> getDateTimeValid(); + Single>> getDateTimeValid(); @PUT("array/prim/date-time/valid") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single putDateTimeValid(@BodyParam("application/json; charset=utf-8") List arrayBody); + Single putDateTimeValid(@BodyParam("application/json; charset=utf-8") List arrayBody); @GET("array/prim/date-time/invalidnull") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single>> getDateTimeInvalidNull(); + Single>> getDateTimeInvalidNull(); @GET("array/prim/date-time/invalidchars") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single>> getDateTimeInvalidChars(); + Single>> getDateTimeInvalidChars(); @GET("array/prim/date-time-rfc1123/valid") @ExpectedResponses({200}) @ReturnValueWireType(DateTimeRfc1123.class) @UnexpectedResponseExceptionType(ErrorException.class) - Single>> getDateTimeRfc1123Valid(); + Single>> getDateTimeRfc1123Valid(); @PUT("array/prim/date-time-rfc1123/valid") @ExpectedResponses({200}) @@ -281,12 +281,12 @@ private interface ArraysService { @GET("array/prim/duration/valid") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single>> getDurationValid(); + Single>> getDurationValid(); @PUT("array/prim/duration/valid") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single putDurationValid(@BodyParam("application/json; charset=utf-8") List arrayBody); + Single putDurationValid(@BodyParam("application/json; charset=utf-8") List arrayBody); @GET("array/prim/byte/valid") @ExpectedResponses({200}) @@ -1930,9 +1930,9 @@ public Maybe> getDateInvalidCharsAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List<DateTime> object if successful. + * @return the List<OffsetDateTime> object if successful. */ - public List getDateTimeValid() { + public List getDateTimeValid() { return getDateTimeValidAsync().blockingGet(); } @@ -1943,7 +1943,7 @@ public List getDateTimeValid() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture> getDateTimeValidAsync(ServiceCallback> serviceCallback) { + public ServiceFuture> getDateTimeValidAsync(ServiceCallback> serviceCallback) { return ServiceFuture.fromBody(getDateTimeValidAsync(), serviceCallback); } @@ -1952,7 +1952,7 @@ public ServiceFuture> getDateTimeValidAsync(ServiceCallback>> getDateTimeValidWithRestResponseAsync() { + public Single>> getDateTimeValidWithRestResponseAsync() { return service.getDateTimeValid(); } @@ -1961,43 +1961,43 @@ public Single>> getDateTimeValidWithRestResponseAsyn * * @return a Single which performs the network request upon subscription. */ - public Maybe> getDateTimeValidAsync() { + public Maybe> getDateTimeValidAsync() { return getDateTimeValidWithRestResponseAsync() - .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putDateTimeValid(@NonNull List arrayBody) { + public void putDateTimeValid(@NonNull List arrayBody) { putDateTimeValidAsync(arrayBody).blockingAwait(); } /** * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putDateTimeValidAsync(@NonNull List arrayBody, ServiceCallback serviceCallback) { + public ServiceFuture putDateTimeValidAsync(@NonNull List arrayBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putDateTimeValidAsync(arrayBody), serviceCallback); } /** * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putDateTimeValidWithRestResponseAsync(@NonNull List arrayBody) { + public Single putDateTimeValidWithRestResponseAsync(@NonNull List arrayBody) { if (arrayBody == null) { throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); } @@ -2008,11 +2008,11 @@ public Single putDateTimeValidWithRestResponseAsync(@NonNull List< /** * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable putDateTimeValidAsync(@NonNull List arrayBody) { + public Completable putDateTimeValidAsync(@NonNull List arrayBody) { return putDateTimeValidWithRestResponseAsync(arrayBody) .toCompletable(); } @@ -2022,9 +2022,9 @@ public Completable putDateTimeValidAsync(@NonNull List arrayBody) { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List<DateTime> object if successful. + * @return the List<OffsetDateTime> object if successful. */ - public List getDateTimeInvalidNull() { + public List getDateTimeInvalidNull() { return getDateTimeInvalidNullAsync().blockingGet(); } @@ -2035,7 +2035,7 @@ public List getDateTimeInvalidNull() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture> getDateTimeInvalidNullAsync(ServiceCallback> serviceCallback) { + public ServiceFuture> getDateTimeInvalidNullAsync(ServiceCallback> serviceCallback) { return ServiceFuture.fromBody(getDateTimeInvalidNullAsync(), serviceCallback); } @@ -2044,7 +2044,7 @@ public ServiceFuture> getDateTimeInvalidNullAsync(ServiceCallback * * @return a Single which performs the network request upon subscription. */ - public Single>> getDateTimeInvalidNullWithRestResponseAsync() { + public Single>> getDateTimeInvalidNullWithRestResponseAsync() { return service.getDateTimeInvalidNull(); } @@ -2053,9 +2053,9 @@ public Single>> getDateTimeInvalidNullWithRestRespon * * @return a Single which performs the network request upon subscription. */ - public Maybe> getDateTimeInvalidNullAsync() { + public Maybe> getDateTimeInvalidNullAsync() { return getDateTimeInvalidNullWithRestResponseAsync() - .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -2063,9 +2063,9 @@ public Maybe> getDateTimeInvalidNullAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List<DateTime> object if successful. + * @return the List<OffsetDateTime> object if successful. */ - public List getDateTimeInvalidChars() { + public List getDateTimeInvalidChars() { return getDateTimeInvalidCharsAsync().blockingGet(); } @@ -2076,7 +2076,7 @@ public List getDateTimeInvalidChars() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture> getDateTimeInvalidCharsAsync(ServiceCallback> serviceCallback) { + public ServiceFuture> getDateTimeInvalidCharsAsync(ServiceCallback> serviceCallback) { return ServiceFuture.fromBody(getDateTimeInvalidCharsAsync(), serviceCallback); } @@ -2085,7 +2085,7 @@ public ServiceFuture> getDateTimeInvalidCharsAsync(ServiceCallbac * * @return a Single which performs the network request upon subscription. */ - public Single>> getDateTimeInvalidCharsWithRestResponseAsync() { + public Single>> getDateTimeInvalidCharsWithRestResponseAsync() { return service.getDateTimeInvalidChars(); } @@ -2094,9 +2094,9 @@ public Single>> getDateTimeInvalidCharsWithRestRespo * * @return a Single which performs the network request upon subscription. */ - public Maybe> getDateTimeInvalidCharsAsync() { + public Maybe> getDateTimeInvalidCharsAsync() { return getDateTimeInvalidCharsWithRestResponseAsync() - .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -2104,9 +2104,9 @@ public Maybe> getDateTimeInvalidCharsAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List<DateTime> object if successful. + * @return the List<OffsetDateTime> object if successful. */ - public List getDateTimeRfc1123Valid() { + public List getDateTimeRfc1123Valid() { return getDateTimeRfc1123ValidAsync().blockingGet(); } @@ -2117,7 +2117,7 @@ public List getDateTimeRfc1123Valid() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture> getDateTimeRfc1123ValidAsync(ServiceCallback> serviceCallback) { + public ServiceFuture> getDateTimeRfc1123ValidAsync(ServiceCallback> serviceCallback) { return ServiceFuture.fromBody(getDateTimeRfc1123ValidAsync(), serviceCallback); } @@ -2126,7 +2126,7 @@ public ServiceFuture> getDateTimeRfc1123ValidAsync(ServiceCallbac * * @return a Single which performs the network request upon subscription. */ - public Single>> getDateTimeRfc1123ValidWithRestResponseAsync() { + public Single>> getDateTimeRfc1123ValidWithRestResponseAsync() { return service.getDateTimeRfc1123Valid(); } @@ -2135,49 +2135,49 @@ public Single>> getDateTimeRfc1123ValidWithRestRespo * * @return a Single which performs the network request upon subscription. */ - public Maybe> getDateTimeRfc1123ValidAsync() { + public Maybe> getDateTimeRfc1123ValidAsync() { return getDateTimeRfc1123ValidWithRestResponseAsync() - .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putDateTimeRfc1123Valid(@NonNull List arrayBody) { + public void putDateTimeRfc1123Valid(@NonNull List arrayBody) { putDateTimeRfc1123ValidAsync(arrayBody).blockingAwait(); } /** * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putDateTimeRfc1123ValidAsync(@NonNull List arrayBody, ServiceCallback serviceCallback) { + public ServiceFuture putDateTimeRfc1123ValidAsync(@NonNull List arrayBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putDateTimeRfc1123ValidAsync(arrayBody), serviceCallback); } /** * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putDateTimeRfc1123ValidWithRestResponseAsync(@NonNull List arrayBody) { + public Single putDateTimeRfc1123ValidWithRestResponseAsync(@NonNull List arrayBody) { if (arrayBody == null) { throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); } Validator.validate(arrayBody); List arrayBodyConverted = new ArrayList(); - for (DateTime item : arrayBody) { + for (OffsetDateTime item : arrayBody) { DateTimeRfc1123 value = new DateTimeRfc1123(item); arrayBodyConverted.add(value); } @@ -2187,11 +2187,11 @@ public Single putDateTimeRfc1123ValidWithRestResponseAsync(@NonNul /** * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. * - * @param arrayBody the List<DateTime> value. + * @param arrayBody the List<OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable putDateTimeRfc1123ValidAsync(@NonNull List arrayBody) { + public Completable putDateTimeRfc1123ValidAsync(@NonNull List arrayBody) { return putDateTimeRfc1123ValidWithRestResponseAsync(arrayBody) .toCompletable(); } @@ -2201,9 +2201,9 @@ public Completable putDateTimeRfc1123ValidAsync(@NonNull List arrayBod * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List<Period> object if successful. + * @return the List<Duration> object if successful. */ - public List getDurationValid() { + public List getDurationValid() { return getDurationValidAsync().blockingGet(); } @@ -2214,7 +2214,7 @@ public List getDurationValid() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture> getDurationValidAsync(ServiceCallback> serviceCallback) { + public ServiceFuture> getDurationValidAsync(ServiceCallback> serviceCallback) { return ServiceFuture.fromBody(getDurationValidAsync(), serviceCallback); } @@ -2223,7 +2223,7 @@ public ServiceFuture> getDurationValidAsync(ServiceCallback>> getDurationValidWithRestResponseAsync() { + public Single>> getDurationValidWithRestResponseAsync() { return service.getDurationValid(); } @@ -2232,43 +2232,43 @@ public Single>> getDurationValidWithRestResponseAsync( * * @return a Single which performs the network request upon subscription. */ - public Maybe> getDurationValidAsync() { + public Maybe> getDurationValidAsync() { return getDurationValidWithRestResponseAsync() - .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. * - * @param arrayBody the List<Period> value. + * @param arrayBody the List<Duration> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putDurationValid(@NonNull List arrayBody) { + public void putDurationValid(@NonNull List arrayBody) { putDurationValidAsync(arrayBody).blockingAwait(); } /** * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. * - * @param arrayBody the List<Period> value. + * @param arrayBody the List<Duration> value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putDurationValidAsync(@NonNull List arrayBody, ServiceCallback serviceCallback) { + public ServiceFuture putDurationValidAsync(@NonNull List arrayBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putDurationValidAsync(arrayBody), serviceCallback); } /** * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. * - * @param arrayBody the List<Period> value. + * @param arrayBody the List<Duration> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putDurationValidWithRestResponseAsync(@NonNull List arrayBody) { + public Single putDurationValidWithRestResponseAsync(@NonNull List arrayBody) { if (arrayBody == null) { throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); } @@ -2279,11 +2279,11 @@ public Single putDurationValidWithRestResponseAsync(@NonNull List< /** * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. * - * @param arrayBody the List<Period> value. + * @param arrayBody the List<Duration> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable putDurationValidAsync(@NonNull List arrayBody) { + public Completable putDurationValidAsync(@NonNull List arrayBody) { return putDurationValidWithRestResponseAsync(arrayBody) .toCompletable(); } diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/DateWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DateWrapper.java index 150b1b1f8b..08e9deff6e 100644 --- a/test/vanilla/src/main/java/fixtures/bodycomplex/models/DateWrapper.java +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DateWrapper.java @@ -11,7 +11,7 @@ package fixtures.bodycomplex.models; import com.fasterxml.jackson.annotation.JsonProperty; -import org.joda.time.LocalDate; +import java.time.LocalDate; /** * The DateWrapper model. diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/DatetimeWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DatetimeWrapper.java index 979653015e..dd6a6764a1 100644 --- a/test/vanilla/src/main/java/fixtures/bodycomplex/models/DatetimeWrapper.java +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DatetimeWrapper.java @@ -11,7 +11,7 @@ package fixtures.bodycomplex.models; import com.fasterxml.jackson.annotation.JsonProperty; -import org.joda.time.DateTime; +import java.time.OffsetDateTime; /** * The DatetimeWrapper model. @@ -21,20 +21,20 @@ public final class DatetimeWrapper { * The field property. */ @JsonProperty(value = "field") - private DateTime field; + private OffsetDateTime field; /** * The now property. */ @JsonProperty(value = "now") - private DateTime now; + private OffsetDateTime now; /** * Get the field value. * * @return the field value. */ - public DateTime field() { + public OffsetDateTime field() { return this.field; } @@ -44,7 +44,7 @@ public DateTime field() { * @param field the field value to set. * @return the DatetimeWrapper object itself. */ - public DatetimeWrapper withField(DateTime field) { + public DatetimeWrapper withField(OffsetDateTime field) { this.field = field; return this; } @@ -54,7 +54,7 @@ public DatetimeWrapper withField(DateTime field) { * * @return the now value. */ - public DateTime now() { + public OffsetDateTime now() { return this.now; } @@ -64,7 +64,7 @@ public DateTime now() { * @param now the now value to set. * @return the DatetimeWrapper object itself. */ - public DatetimeWrapper withNow(DateTime now) { + public DatetimeWrapper withNow(OffsetDateTime now) { this.now = now; return this; } diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Datetimerfc1123Wrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Datetimerfc1123Wrapper.java index 256f57ca69..8223613538 100644 --- a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Datetimerfc1123Wrapper.java +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Datetimerfc1123Wrapper.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.v2.DateTimeRfc1123; -import org.joda.time.DateTime; +import java.time.OffsetDateTime; /** * The Datetimerfc1123Wrapper model. @@ -35,7 +35,7 @@ public final class Datetimerfc1123Wrapper { * * @return the field value. */ - public DateTime field() { + public OffsetDateTime field() { if (this.field == null) { return null; } @@ -48,7 +48,7 @@ public DateTime field() { * @param field the field value to set. * @return the Datetimerfc1123Wrapper object itself. */ - public Datetimerfc1123Wrapper withField(DateTime field) { + public Datetimerfc1123Wrapper withField(OffsetDateTime field) { if (field == null) { this.field = null; } else { @@ -62,7 +62,7 @@ public Datetimerfc1123Wrapper withField(DateTime field) { * * @return the now value. */ - public DateTime now() { + public OffsetDateTime now() { if (this.now == null) { return null; } @@ -75,7 +75,7 @@ public DateTime now() { * @param now the now value to set. * @return the Datetimerfc1123Wrapper object itself. */ - public Datetimerfc1123Wrapper withNow(DateTime now) { + public Datetimerfc1123Wrapper withNow(OffsetDateTime now) { if (now == null) { this.now = null; } else { diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/DurationWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DurationWrapper.java index e7259e0bbb..effcae756f 100644 --- a/test/vanilla/src/main/java/fixtures/bodycomplex/models/DurationWrapper.java +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DurationWrapper.java @@ -11,7 +11,7 @@ package fixtures.bodycomplex.models; import com.fasterxml.jackson.annotation.JsonProperty; -import org.joda.time.Period; +import java.time.Duration; /** * The DurationWrapper model. @@ -21,14 +21,14 @@ public final class DurationWrapper { * The field property. */ @JsonProperty(value = "field") - private Period field; + private Duration field; /** * Get the field value. * * @return the field value. */ - public Period field() { + public Duration field() { return this.field; } @@ -38,7 +38,7 @@ public Period field() { * @param field the field value to set. * @return the DurationWrapper object itself. */ - public DurationWrapper withField(Period field) { + public DurationWrapper withField(Duration field) { this.field = field; return this; } diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Shark.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Shark.java index a433d9f233..4c9c68b4e1 100644 --- a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Shark.java +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Shark.java @@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import org.joda.time.DateTime; +import java.time.OffsetDateTime; /** * The Shark model. @@ -37,7 +37,7 @@ public class Shark extends Fish { * The birthday property. */ @JsonProperty(value = "birthday", required = true) - private DateTime birthday; + private OffsetDateTime birthday; /** * Get the age value. @@ -64,7 +64,7 @@ public Shark withAge(Integer age) { * * @return the birthday value. */ - public DateTime birthday() { + public OffsetDateTime birthday() { return this.birthday; } @@ -74,7 +74,7 @@ public DateTime birthday() { * @param birthday the birthday value to set. * @return the Shark object itself. */ - public Shark withBirthday(DateTime birthday) { + public Shark withBirthday(OffsetDateTime birthday) { this.birthday = birthday; return this; } diff --git a/test/vanilla/src/main/java/fixtures/bodydate/Dates.java b/test/vanilla/src/main/java/fixtures/bodydate/Dates.java index 467be9aa7b..03491843d2 100644 --- a/test/vanilla/src/main/java/fixtures/bodydate/Dates.java +++ b/test/vanilla/src/main/java/fixtures/bodydate/Dates.java @@ -19,7 +19,7 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; -import org.joda.time.LocalDate; +import java.time.LocalDate; /** * An instance of this class provides access to all the operations defined in diff --git a/test/vanilla/src/main/java/fixtures/bodydate/implementation/DatesImpl.java b/test/vanilla/src/main/java/fixtures/bodydate/implementation/DatesImpl.java index 143d670a36..c7026db342 100644 --- a/test/vanilla/src/main/java/fixtures/bodydate/implementation/DatesImpl.java +++ b/test/vanilla/src/main/java/fixtures/bodydate/implementation/DatesImpl.java @@ -27,7 +27,7 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; -import org.joda.time.LocalDate; +import java.time.LocalDate; /** * An instance of this class provides access to all the operations defined in diff --git a/test/vanilla/src/main/java/fixtures/bodydatetime/Datetimes.java b/test/vanilla/src/main/java/fixtures/bodydatetime/Datetimes.java index 6282e9ec8b..33f743391f 100644 --- a/test/vanilla/src/main/java/fixtures/bodydatetime/Datetimes.java +++ b/test/vanilla/src/main/java/fixtures/bodydatetime/Datetimes.java @@ -19,7 +19,7 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; -import org.joda.time.DateTime; +import java.time.OffsetDateTime; /** * An instance of this class provides access to all the operations defined in @@ -31,9 +31,9 @@ public interface Datetimes { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getNull(); + OffsetDateTime getNull(); /** * Get null datetime value. @@ -42,30 +42,30 @@ public interface Datetimes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getNullAsync(ServiceCallback serviceCallback); + ServiceFuture getNullAsync(ServiceCallback serviceCallback); /** * Get null datetime value. * * @return a Single which performs the network request upon subscription. */ - Single> getNullWithRestResponseAsync(); + Single> getNullWithRestResponseAsync(); /** * Get null datetime value. * * @return a Single which performs the network request upon subscription. */ - Maybe getNullAsync(); + Maybe getNullAsync(); /** * Get invalid datetime value. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getInvalid(); + OffsetDateTime getInvalid(); /** * Get invalid datetime value. @@ -74,30 +74,30 @@ public interface Datetimes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getInvalidAsync(ServiceCallback serviceCallback); + ServiceFuture getInvalidAsync(ServiceCallback serviceCallback); /** * Get invalid datetime value. * * @return a Single which performs the network request upon subscription. */ - Single> getInvalidWithRestResponseAsync(); + Single> getInvalidWithRestResponseAsync(); /** * Get invalid datetime value. * * @return a Single which performs the network request upon subscription. */ - Maybe getInvalidAsync(); + Maybe getInvalidAsync(); /** * Get overflow datetime value. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getOverflow(); + OffsetDateTime getOverflow(); /** * Get overflow datetime value. @@ -106,30 +106,30 @@ public interface Datetimes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getOverflowAsync(ServiceCallback serviceCallback); + ServiceFuture getOverflowAsync(ServiceCallback serviceCallback); /** * Get overflow datetime value. * * @return a Single which performs the network request upon subscription. */ - Single> getOverflowWithRestResponseAsync(); + Single> getOverflowWithRestResponseAsync(); /** * Get overflow datetime value. * * @return a Single which performs the network request upon subscription. */ - Maybe getOverflowAsync(); + Maybe getOverflowAsync(); /** * Get underflow datetime value. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getUnderflow(); + OffsetDateTime getUnderflow(); /** * Get underflow datetime value. @@ -138,68 +138,68 @@ public interface Datetimes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getUnderflowAsync(ServiceCallback serviceCallback); + ServiceFuture getUnderflowAsync(ServiceCallback serviceCallback); /** * Get underflow datetime value. * * @return a Single which performs the network request upon subscription. */ - Single> getUnderflowWithRestResponseAsync(); + Single> getUnderflowWithRestResponseAsync(); /** * Get underflow datetime value. * * @return a Single which performs the network request upon subscription. */ - Maybe getUnderflowAsync(); + Maybe getUnderflowAsync(); /** * Put max datetime value 9999-12-31T23:59:59.9999999Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putUtcMaxDateTime(@NonNull DateTime datetimeBody); + void putUtcMaxDateTime(@NonNull OffsetDateTime datetimeBody); /** * Put max datetime value 9999-12-31T23:59:59.9999999Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putUtcMaxDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback); + ServiceFuture putUtcMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback); /** * Put max datetime value 9999-12-31T23:59:59.9999999Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putUtcMaxDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody); + Single putUtcMaxDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody); /** * Put max datetime value 9999-12-31T23:59:59.9999999Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putUtcMaxDateTimeAsync(@NonNull DateTime datetimeBody); + Completable putUtcMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody); /** * Get max datetime value 9999-12-31t23:59:59.9999999z. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getUtcLowercaseMaxDateTime(); + OffsetDateTime getUtcLowercaseMaxDateTime(); /** * Get max datetime value 9999-12-31t23:59:59.9999999z. @@ -208,30 +208,30 @@ public interface Datetimes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getUtcLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getUtcLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback); /** * Get max datetime value 9999-12-31t23:59:59.9999999z. * * @return a Single which performs the network request upon subscription. */ - Single> getUtcLowercaseMaxDateTimeWithRestResponseAsync(); + Single> getUtcLowercaseMaxDateTimeWithRestResponseAsync(); /** * Get max datetime value 9999-12-31t23:59:59.9999999z. * * @return a Single which performs the network request upon subscription. */ - Maybe getUtcLowercaseMaxDateTimeAsync(); + Maybe getUtcLowercaseMaxDateTimeAsync(); /** * Get max datetime value 9999-12-31T23:59:59.9999999Z. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getUtcUppercaseMaxDateTime(); + OffsetDateTime getUtcUppercaseMaxDateTime(); /** * Get max datetime value 9999-12-31T23:59:59.9999999Z. @@ -240,68 +240,68 @@ public interface Datetimes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getUtcUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getUtcUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback); /** * Get max datetime value 9999-12-31T23:59:59.9999999Z. * * @return a Single which performs the network request upon subscription. */ - Single> getUtcUppercaseMaxDateTimeWithRestResponseAsync(); + Single> getUtcUppercaseMaxDateTimeWithRestResponseAsync(); /** * Get max datetime value 9999-12-31T23:59:59.9999999Z. * * @return a Single which performs the network request upon subscription. */ - Maybe getUtcUppercaseMaxDateTimeAsync(); + Maybe getUtcUppercaseMaxDateTimeAsync(); /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putLocalPositiveOffsetMaxDateTime(@NonNull DateTime datetimeBody); + void putLocalPositiveOffsetMaxDateTime(@NonNull OffsetDateTime datetimeBody); /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putLocalPositiveOffsetMaxDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback); + ServiceFuture putLocalPositiveOffsetMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback); /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putLocalPositiveOffsetMaxDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody); + Single putLocalPositiveOffsetMaxDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody); /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putLocalPositiveOffsetMaxDateTimeAsync(@NonNull DateTime datetimeBody); + Completable putLocalPositiveOffsetMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody); /** * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999+14:00. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getLocalPositiveOffsetLowercaseMaxDateTime(); + OffsetDateTime getLocalPositiveOffsetLowercaseMaxDateTime(); /** * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999+14:00. @@ -310,30 +310,30 @@ public interface Datetimes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getLocalPositiveOffsetLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getLocalPositiveOffsetLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback); /** * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999+14:00. * * @return a Single which performs the network request upon subscription. */ - Single> getLocalPositiveOffsetLowercaseMaxDateTimeWithRestResponseAsync(); + Single> getLocalPositiveOffsetLowercaseMaxDateTimeWithRestResponseAsync(); /** * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999+14:00. * * @return a Single which performs the network request upon subscription. */ - Maybe getLocalPositiveOffsetLowercaseMaxDateTimeAsync(); + Maybe getLocalPositiveOffsetLowercaseMaxDateTimeAsync(); /** * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999+14:00. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getLocalPositiveOffsetUppercaseMaxDateTime(); + OffsetDateTime getLocalPositiveOffsetUppercaseMaxDateTime(); /** * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999+14:00. @@ -342,68 +342,68 @@ public interface Datetimes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getLocalPositiveOffsetUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getLocalPositiveOffsetUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback); /** * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999+14:00. * * @return a Single which performs the network request upon subscription. */ - Single> getLocalPositiveOffsetUppercaseMaxDateTimeWithRestResponseAsync(); + Single> getLocalPositiveOffsetUppercaseMaxDateTimeWithRestResponseAsync(); /** * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999+14:00. * * @return a Single which performs the network request upon subscription. */ - Maybe getLocalPositiveOffsetUppercaseMaxDateTimeAsync(); + Maybe getLocalPositiveOffsetUppercaseMaxDateTimeAsync(); /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putLocalNegativeOffsetMaxDateTime(@NonNull DateTime datetimeBody); + void putLocalNegativeOffsetMaxDateTime(@NonNull OffsetDateTime datetimeBody); /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putLocalNegativeOffsetMaxDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback); + ServiceFuture putLocalNegativeOffsetMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback); /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putLocalNegativeOffsetMaxDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody); + Single putLocalNegativeOffsetMaxDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody); /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putLocalNegativeOffsetMaxDateTimeAsync(@NonNull DateTime datetimeBody); + Completable putLocalNegativeOffsetMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody); /** * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999-14:00. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getLocalNegativeOffsetUppercaseMaxDateTime(); + OffsetDateTime getLocalNegativeOffsetUppercaseMaxDateTime(); /** * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999-14:00. @@ -412,30 +412,30 @@ public interface Datetimes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getLocalNegativeOffsetUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getLocalNegativeOffsetUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback); /** * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999-14:00. * * @return a Single which performs the network request upon subscription. */ - Single> getLocalNegativeOffsetUppercaseMaxDateTimeWithRestResponseAsync(); + Single> getLocalNegativeOffsetUppercaseMaxDateTimeWithRestResponseAsync(); /** * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999-14:00. * * @return a Single which performs the network request upon subscription. */ - Maybe getLocalNegativeOffsetUppercaseMaxDateTimeAsync(); + Maybe getLocalNegativeOffsetUppercaseMaxDateTimeAsync(); /** * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999-14:00. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getLocalNegativeOffsetLowercaseMaxDateTime(); + OffsetDateTime getLocalNegativeOffsetLowercaseMaxDateTime(); /** * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999-14:00. @@ -444,68 +444,68 @@ public interface Datetimes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getLocalNegativeOffsetLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getLocalNegativeOffsetLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback); /** * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999-14:00. * * @return a Single which performs the network request upon subscription. */ - Single> getLocalNegativeOffsetLowercaseMaxDateTimeWithRestResponseAsync(); + Single> getLocalNegativeOffsetLowercaseMaxDateTimeWithRestResponseAsync(); /** * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999-14:00. * * @return a Single which performs the network request upon subscription. */ - Maybe getLocalNegativeOffsetLowercaseMaxDateTimeAsync(); + Maybe getLocalNegativeOffsetLowercaseMaxDateTimeAsync(); /** * Put min datetime value 0001-01-01T00:00:00Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putUtcMinDateTime(@NonNull DateTime datetimeBody); + void putUtcMinDateTime(@NonNull OffsetDateTime datetimeBody); /** * Put min datetime value 0001-01-01T00:00:00Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putUtcMinDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback); + ServiceFuture putUtcMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback); /** * Put min datetime value 0001-01-01T00:00:00Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putUtcMinDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody); + Single putUtcMinDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody); /** * Put min datetime value 0001-01-01T00:00:00Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putUtcMinDateTimeAsync(@NonNull DateTime datetimeBody); + Completable putUtcMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody); /** * Get min datetime value 0001-01-01T00:00:00Z. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getUtcMinDateTime(); + OffsetDateTime getUtcMinDateTime(); /** * Get min datetime value 0001-01-01T00:00:00Z. @@ -514,68 +514,68 @@ public interface Datetimes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getUtcMinDateTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getUtcMinDateTimeAsync(ServiceCallback serviceCallback); /** * Get min datetime value 0001-01-01T00:00:00Z. * * @return a Single which performs the network request upon subscription. */ - Single> getUtcMinDateTimeWithRestResponseAsync(); + Single> getUtcMinDateTimeWithRestResponseAsync(); /** * Get min datetime value 0001-01-01T00:00:00Z. * * @return a Single which performs the network request upon subscription. */ - Maybe getUtcMinDateTimeAsync(); + Maybe getUtcMinDateTimeAsync(); /** * Put min datetime value 0001-01-01T00:00:00+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putLocalPositiveOffsetMinDateTime(@NonNull DateTime datetimeBody); + void putLocalPositiveOffsetMinDateTime(@NonNull OffsetDateTime datetimeBody); /** * Put min datetime value 0001-01-01T00:00:00+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putLocalPositiveOffsetMinDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback); + ServiceFuture putLocalPositiveOffsetMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback); /** * Put min datetime value 0001-01-01T00:00:00+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putLocalPositiveOffsetMinDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody); + Single putLocalPositiveOffsetMinDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody); /** * Put min datetime value 0001-01-01T00:00:00+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putLocalPositiveOffsetMinDateTimeAsync(@NonNull DateTime datetimeBody); + Completable putLocalPositiveOffsetMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody); /** * Get min datetime value 0001-01-01T00:00:00+14:00. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getLocalPositiveOffsetMinDateTime(); + OffsetDateTime getLocalPositiveOffsetMinDateTime(); /** * Get min datetime value 0001-01-01T00:00:00+14:00. @@ -584,68 +584,68 @@ public interface Datetimes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getLocalPositiveOffsetMinDateTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getLocalPositiveOffsetMinDateTimeAsync(ServiceCallback serviceCallback); /** * Get min datetime value 0001-01-01T00:00:00+14:00. * * @return a Single which performs the network request upon subscription. */ - Single> getLocalPositiveOffsetMinDateTimeWithRestResponseAsync(); + Single> getLocalPositiveOffsetMinDateTimeWithRestResponseAsync(); /** * Get min datetime value 0001-01-01T00:00:00+14:00. * * @return a Single which performs the network request upon subscription. */ - Maybe getLocalPositiveOffsetMinDateTimeAsync(); + Maybe getLocalPositiveOffsetMinDateTimeAsync(); /** * Put min datetime value 0001-01-01T00:00:00-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putLocalNegativeOffsetMinDateTime(@NonNull DateTime datetimeBody); + void putLocalNegativeOffsetMinDateTime(@NonNull OffsetDateTime datetimeBody); /** * Put min datetime value 0001-01-01T00:00:00-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putLocalNegativeOffsetMinDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback); + ServiceFuture putLocalNegativeOffsetMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback); /** * Put min datetime value 0001-01-01T00:00:00-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putLocalNegativeOffsetMinDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody); + Single putLocalNegativeOffsetMinDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody); /** * Put min datetime value 0001-01-01T00:00:00-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putLocalNegativeOffsetMinDateTimeAsync(@NonNull DateTime datetimeBody); + Completable putLocalNegativeOffsetMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody); /** * Get min datetime value 0001-01-01T00:00:00-14:00. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getLocalNegativeOffsetMinDateTime(); + OffsetDateTime getLocalNegativeOffsetMinDateTime(); /** * Get min datetime value 0001-01-01T00:00:00-14:00. @@ -654,19 +654,19 @@ public interface Datetimes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getLocalNegativeOffsetMinDateTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getLocalNegativeOffsetMinDateTimeAsync(ServiceCallback serviceCallback); /** * Get min datetime value 0001-01-01T00:00:00-14:00. * * @return a Single which performs the network request upon subscription. */ - Single> getLocalNegativeOffsetMinDateTimeWithRestResponseAsync(); + Single> getLocalNegativeOffsetMinDateTimeWithRestResponseAsync(); /** * Get min datetime value 0001-01-01T00:00:00-14:00. * * @return a Single which performs the network request upon subscription. */ - Maybe getLocalNegativeOffsetMinDateTimeAsync(); + Maybe getLocalNegativeOffsetMinDateTimeAsync(); } diff --git a/test/vanilla/src/main/java/fixtures/bodydatetime/implementation/DatetimesImpl.java b/test/vanilla/src/main/java/fixtures/bodydatetime/implementation/DatetimesImpl.java index 5f96658cb7..c639f33ba5 100644 --- a/test/vanilla/src/main/java/fixtures/bodydatetime/implementation/DatetimesImpl.java +++ b/test/vanilla/src/main/java/fixtures/bodydatetime/implementation/DatetimesImpl.java @@ -27,7 +27,7 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; -import org.joda.time.DateTime; +import java.time.OffsetDateTime; /** * An instance of this class provides access to all the operations defined in @@ -63,97 +63,97 @@ private interface DatetimesService { @GET("datetime/null") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getNull(); + Single> getNull(); @GET("datetime/invalid") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getInvalid(); + Single> getInvalid(); @GET("datetime/overflow") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getOverflow(); + Single> getOverflow(); @GET("datetime/underflow") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getUnderflow(); + Single> getUnderflow(); @PUT("datetime/max/utc") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single putUtcMaxDateTime(@BodyParam("application/json; charset=utf-8") DateTime datetimeBody); + Single putUtcMaxDateTime(@BodyParam("application/json; charset=utf-8") OffsetDateTime datetimeBody); @GET("datetime/max/utc/lowercase") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getUtcLowercaseMaxDateTime(); + Single> getUtcLowercaseMaxDateTime(); @GET("datetime/max/utc/uppercase") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getUtcUppercaseMaxDateTime(); + Single> getUtcUppercaseMaxDateTime(); @PUT("datetime/max/localpositiveoffset") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single putLocalPositiveOffsetMaxDateTime(@BodyParam("application/json; charset=utf-8") DateTime datetimeBody); + Single putLocalPositiveOffsetMaxDateTime(@BodyParam("application/json; charset=utf-8") OffsetDateTime datetimeBody); @GET("datetime/max/localpositiveoffset/lowercase") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getLocalPositiveOffsetLowercaseMaxDateTime(); + Single> getLocalPositiveOffsetLowercaseMaxDateTime(); @GET("datetime/max/localpositiveoffset/uppercase") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getLocalPositiveOffsetUppercaseMaxDateTime(); + Single> getLocalPositiveOffsetUppercaseMaxDateTime(); @PUT("datetime/max/localnegativeoffset") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single putLocalNegativeOffsetMaxDateTime(@BodyParam("application/json; charset=utf-8") DateTime datetimeBody); + Single putLocalNegativeOffsetMaxDateTime(@BodyParam("application/json; charset=utf-8") OffsetDateTime datetimeBody); @GET("datetime/max/localnegativeoffset/uppercase") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getLocalNegativeOffsetUppercaseMaxDateTime(); + Single> getLocalNegativeOffsetUppercaseMaxDateTime(); @GET("datetime/max/localnegativeoffset/lowercase") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getLocalNegativeOffsetLowercaseMaxDateTime(); + Single> getLocalNegativeOffsetLowercaseMaxDateTime(); @PUT("datetime/min/utc") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single putUtcMinDateTime(@BodyParam("application/json; charset=utf-8") DateTime datetimeBody); + Single putUtcMinDateTime(@BodyParam("application/json; charset=utf-8") OffsetDateTime datetimeBody); @GET("datetime/min/utc") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getUtcMinDateTime(); + Single> getUtcMinDateTime(); @PUT("datetime/min/localpositiveoffset") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single putLocalPositiveOffsetMinDateTime(@BodyParam("application/json; charset=utf-8") DateTime datetimeBody); + Single putLocalPositiveOffsetMinDateTime(@BodyParam("application/json; charset=utf-8") OffsetDateTime datetimeBody); @GET("datetime/min/localpositiveoffset") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getLocalPositiveOffsetMinDateTime(); + Single> getLocalPositiveOffsetMinDateTime(); @PUT("datetime/min/localnegativeoffset") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single putLocalNegativeOffsetMinDateTime(@BodyParam("application/json; charset=utf-8") DateTime datetimeBody); + Single putLocalNegativeOffsetMinDateTime(@BodyParam("application/json; charset=utf-8") OffsetDateTime datetimeBody); @GET("datetime/min/localnegativeoffset") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getLocalNegativeOffsetMinDateTime(); + Single> getLocalNegativeOffsetMinDateTime(); } /** @@ -161,9 +161,9 @@ private interface DatetimesService { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getNull() { + public OffsetDateTime getNull() { return getNullAsync().blockingGet(); } @@ -174,7 +174,7 @@ public DateTime getNull() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getNullAsync(ServiceCallback serviceCallback) { + public ServiceFuture getNullAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getNullAsync(), serviceCallback); } @@ -183,7 +183,7 @@ public ServiceFuture getNullAsync(ServiceCallback serviceCal * * @return a Single which performs the network request upon subscription. */ - public Single> getNullWithRestResponseAsync() { + public Single> getNullWithRestResponseAsync() { return service.getNull(); } @@ -192,9 +192,9 @@ public Single> getNullWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getNullAsync() { + public Maybe getNullAsync() { return getNullWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -202,9 +202,9 @@ public Maybe getNullAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getInvalid() { + public OffsetDateTime getInvalid() { return getInvalidAsync().blockingGet(); } @@ -215,7 +215,7 @@ public DateTime getInvalid() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getInvalidAsync(ServiceCallback serviceCallback) { + public ServiceFuture getInvalidAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getInvalidAsync(), serviceCallback); } @@ -224,7 +224,7 @@ public ServiceFuture getInvalidAsync(ServiceCallback service * * @return a Single which performs the network request upon subscription. */ - public Single> getInvalidWithRestResponseAsync() { + public Single> getInvalidWithRestResponseAsync() { return service.getInvalid(); } @@ -233,9 +233,9 @@ public Single> getInvalidWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getInvalidAsync() { + public Maybe getInvalidAsync() { return getInvalidWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -243,9 +243,9 @@ public Maybe getInvalidAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getOverflow() { + public OffsetDateTime getOverflow() { return getOverflowAsync().blockingGet(); } @@ -256,7 +256,7 @@ public DateTime getOverflow() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getOverflowAsync(ServiceCallback serviceCallback) { + public ServiceFuture getOverflowAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getOverflowAsync(), serviceCallback); } @@ -265,7 +265,7 @@ public ServiceFuture getOverflowAsync(ServiceCallback servic * * @return a Single which performs the network request upon subscription. */ - public Single> getOverflowWithRestResponseAsync() { + public Single> getOverflowWithRestResponseAsync() { return service.getOverflow(); } @@ -274,9 +274,9 @@ public Single> getOverflowWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getOverflowAsync() { + public Maybe getOverflowAsync() { return getOverflowWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -284,9 +284,9 @@ public Maybe getOverflowAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getUnderflow() { + public OffsetDateTime getUnderflow() { return getUnderflowAsync().blockingGet(); } @@ -297,7 +297,7 @@ public DateTime getUnderflow() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getUnderflowAsync(ServiceCallback serviceCallback) { + public ServiceFuture getUnderflowAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getUnderflowAsync(), serviceCallback); } @@ -306,7 +306,7 @@ public ServiceFuture getUnderflowAsync(ServiceCallback servi * * @return a Single which performs the network request upon subscription. */ - public Single> getUnderflowWithRestResponseAsync() { + public Single> getUnderflowWithRestResponseAsync() { return service.getUnderflow(); } @@ -315,43 +315,43 @@ public Single> getUnderflowWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getUnderflowAsync() { + public Maybe getUnderflowAsync() { return getUnderflowWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Put max datetime value 9999-12-31T23:59:59.9999999Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putUtcMaxDateTime(@NonNull DateTime datetimeBody) { + public void putUtcMaxDateTime(@NonNull OffsetDateTime datetimeBody) { putUtcMaxDateTimeAsync(datetimeBody).blockingAwait(); } /** * Put max datetime value 9999-12-31T23:59:59.9999999Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putUtcMaxDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback) { + public ServiceFuture putUtcMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putUtcMaxDateTimeAsync(datetimeBody), serviceCallback); } /** * Put max datetime value 9999-12-31T23:59:59.9999999Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putUtcMaxDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody) { + public Single putUtcMaxDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody) { if (datetimeBody == null) { throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); } @@ -361,11 +361,11 @@ public Single putUtcMaxDateTimeWithRestResponseAsync(@NonNull Date /** * Put max datetime value 9999-12-31T23:59:59.9999999Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable putUtcMaxDateTimeAsync(@NonNull DateTime datetimeBody) { + public Completable putUtcMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody) { return putUtcMaxDateTimeWithRestResponseAsync(datetimeBody) .toCompletable(); } @@ -375,9 +375,9 @@ public Completable putUtcMaxDateTimeAsync(@NonNull DateTime datetimeBody) { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getUtcLowercaseMaxDateTime() { + public OffsetDateTime getUtcLowercaseMaxDateTime() { return getUtcLowercaseMaxDateTimeAsync().blockingGet(); } @@ -388,7 +388,7 @@ public DateTime getUtcLowercaseMaxDateTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getUtcLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getUtcLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getUtcLowercaseMaxDateTimeAsync(), serviceCallback); } @@ -397,7 +397,7 @@ public ServiceFuture getUtcLowercaseMaxDateTimeAsync(ServiceCallback> getUtcLowercaseMaxDateTimeWithRestResponseAsync() { + public Single> getUtcLowercaseMaxDateTimeWithRestResponseAsync() { return service.getUtcLowercaseMaxDateTime(); } @@ -406,9 +406,9 @@ public Single> getUtcLowercaseMaxDateTimeWithRestResponse * * @return a Single which performs the network request upon subscription. */ - public Maybe getUtcLowercaseMaxDateTimeAsync() { + public Maybe getUtcLowercaseMaxDateTimeAsync() { return getUtcLowercaseMaxDateTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -416,9 +416,9 @@ public Maybe getUtcLowercaseMaxDateTimeAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getUtcUppercaseMaxDateTime() { + public OffsetDateTime getUtcUppercaseMaxDateTime() { return getUtcUppercaseMaxDateTimeAsync().blockingGet(); } @@ -429,7 +429,7 @@ public DateTime getUtcUppercaseMaxDateTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getUtcUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getUtcUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getUtcUppercaseMaxDateTimeAsync(), serviceCallback); } @@ -438,7 +438,7 @@ public ServiceFuture getUtcUppercaseMaxDateTimeAsync(ServiceCallback> getUtcUppercaseMaxDateTimeWithRestResponseAsync() { + public Single> getUtcUppercaseMaxDateTimeWithRestResponseAsync() { return service.getUtcUppercaseMaxDateTime(); } @@ -447,43 +447,43 @@ public Single> getUtcUppercaseMaxDateTimeWithRestResponse * * @return a Single which performs the network request upon subscription. */ - public Maybe getUtcUppercaseMaxDateTimeAsync() { + public Maybe getUtcUppercaseMaxDateTimeAsync() { return getUtcUppercaseMaxDateTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putLocalPositiveOffsetMaxDateTime(@NonNull DateTime datetimeBody) { + public void putLocalPositiveOffsetMaxDateTime(@NonNull OffsetDateTime datetimeBody) { putLocalPositiveOffsetMaxDateTimeAsync(datetimeBody).blockingAwait(); } /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putLocalPositiveOffsetMaxDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback) { + public ServiceFuture putLocalPositiveOffsetMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putLocalPositiveOffsetMaxDateTimeAsync(datetimeBody), serviceCallback); } /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putLocalPositiveOffsetMaxDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody) { + public Single putLocalPositiveOffsetMaxDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody) { if (datetimeBody == null) { throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); } @@ -493,11 +493,11 @@ public Single putLocalPositiveOffsetMaxDateTimeWithRestResponseAsy /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable putLocalPositiveOffsetMaxDateTimeAsync(@NonNull DateTime datetimeBody) { + public Completable putLocalPositiveOffsetMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody) { return putLocalPositiveOffsetMaxDateTimeWithRestResponseAsync(datetimeBody) .toCompletable(); } @@ -507,9 +507,9 @@ public Completable putLocalPositiveOffsetMaxDateTimeAsync(@NonNull DateTime date * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getLocalPositiveOffsetLowercaseMaxDateTime() { + public OffsetDateTime getLocalPositiveOffsetLowercaseMaxDateTime() { return getLocalPositiveOffsetLowercaseMaxDateTimeAsync().blockingGet(); } @@ -520,7 +520,7 @@ public DateTime getLocalPositiveOffsetLowercaseMaxDateTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getLocalPositiveOffsetLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getLocalPositiveOffsetLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getLocalPositiveOffsetLowercaseMaxDateTimeAsync(), serviceCallback); } @@ -529,7 +529,7 @@ public ServiceFuture getLocalPositiveOffsetLowercaseMaxDateTimeAsync(S * * @return a Single which performs the network request upon subscription. */ - public Single> getLocalPositiveOffsetLowercaseMaxDateTimeWithRestResponseAsync() { + public Single> getLocalPositiveOffsetLowercaseMaxDateTimeWithRestResponseAsync() { return service.getLocalPositiveOffsetLowercaseMaxDateTime(); } @@ -538,9 +538,9 @@ public Single> getLocalPositiveOffsetLowercaseMaxDateTime * * @return a Single which performs the network request upon subscription. */ - public Maybe getLocalPositiveOffsetLowercaseMaxDateTimeAsync() { + public Maybe getLocalPositiveOffsetLowercaseMaxDateTimeAsync() { return getLocalPositiveOffsetLowercaseMaxDateTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -548,9 +548,9 @@ public Maybe getLocalPositiveOffsetLowercaseMaxDateTimeAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getLocalPositiveOffsetUppercaseMaxDateTime() { + public OffsetDateTime getLocalPositiveOffsetUppercaseMaxDateTime() { return getLocalPositiveOffsetUppercaseMaxDateTimeAsync().blockingGet(); } @@ -561,7 +561,7 @@ public DateTime getLocalPositiveOffsetUppercaseMaxDateTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getLocalPositiveOffsetUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getLocalPositiveOffsetUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getLocalPositiveOffsetUppercaseMaxDateTimeAsync(), serviceCallback); } @@ -570,7 +570,7 @@ public ServiceFuture getLocalPositiveOffsetUppercaseMaxDateTimeAsync(S * * @return a Single which performs the network request upon subscription. */ - public Single> getLocalPositiveOffsetUppercaseMaxDateTimeWithRestResponseAsync() { + public Single> getLocalPositiveOffsetUppercaseMaxDateTimeWithRestResponseAsync() { return service.getLocalPositiveOffsetUppercaseMaxDateTime(); } @@ -579,43 +579,43 @@ public Single> getLocalPositiveOffsetUppercaseMaxDateTime * * @return a Single which performs the network request upon subscription. */ - public Maybe getLocalPositiveOffsetUppercaseMaxDateTimeAsync() { + public Maybe getLocalPositiveOffsetUppercaseMaxDateTimeAsync() { return getLocalPositiveOffsetUppercaseMaxDateTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putLocalNegativeOffsetMaxDateTime(@NonNull DateTime datetimeBody) { + public void putLocalNegativeOffsetMaxDateTime(@NonNull OffsetDateTime datetimeBody) { putLocalNegativeOffsetMaxDateTimeAsync(datetimeBody).blockingAwait(); } /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putLocalNegativeOffsetMaxDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback) { + public ServiceFuture putLocalNegativeOffsetMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putLocalNegativeOffsetMaxDateTimeAsync(datetimeBody), serviceCallback); } /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putLocalNegativeOffsetMaxDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody) { + public Single putLocalNegativeOffsetMaxDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody) { if (datetimeBody == null) { throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); } @@ -625,11 +625,11 @@ public Single putLocalNegativeOffsetMaxDateTimeWithRestResponseAsy /** * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable putLocalNegativeOffsetMaxDateTimeAsync(@NonNull DateTime datetimeBody) { + public Completable putLocalNegativeOffsetMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody) { return putLocalNegativeOffsetMaxDateTimeWithRestResponseAsync(datetimeBody) .toCompletable(); } @@ -639,9 +639,9 @@ public Completable putLocalNegativeOffsetMaxDateTimeAsync(@NonNull DateTime date * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getLocalNegativeOffsetUppercaseMaxDateTime() { + public OffsetDateTime getLocalNegativeOffsetUppercaseMaxDateTime() { return getLocalNegativeOffsetUppercaseMaxDateTimeAsync().blockingGet(); } @@ -652,7 +652,7 @@ public DateTime getLocalNegativeOffsetUppercaseMaxDateTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getLocalNegativeOffsetUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getLocalNegativeOffsetUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getLocalNegativeOffsetUppercaseMaxDateTimeAsync(), serviceCallback); } @@ -661,7 +661,7 @@ public ServiceFuture getLocalNegativeOffsetUppercaseMaxDateTimeAsync(S * * @return a Single which performs the network request upon subscription. */ - public Single> getLocalNegativeOffsetUppercaseMaxDateTimeWithRestResponseAsync() { + public Single> getLocalNegativeOffsetUppercaseMaxDateTimeWithRestResponseAsync() { return service.getLocalNegativeOffsetUppercaseMaxDateTime(); } @@ -670,9 +670,9 @@ public Single> getLocalNegativeOffsetUppercaseMaxDateTime * * @return a Single which performs the network request upon subscription. */ - public Maybe getLocalNegativeOffsetUppercaseMaxDateTimeAsync() { + public Maybe getLocalNegativeOffsetUppercaseMaxDateTimeAsync() { return getLocalNegativeOffsetUppercaseMaxDateTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -680,9 +680,9 @@ public Maybe getLocalNegativeOffsetUppercaseMaxDateTimeAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getLocalNegativeOffsetLowercaseMaxDateTime() { + public OffsetDateTime getLocalNegativeOffsetLowercaseMaxDateTime() { return getLocalNegativeOffsetLowercaseMaxDateTimeAsync().blockingGet(); } @@ -693,7 +693,7 @@ public DateTime getLocalNegativeOffsetLowercaseMaxDateTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getLocalNegativeOffsetLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getLocalNegativeOffsetLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getLocalNegativeOffsetLowercaseMaxDateTimeAsync(), serviceCallback); } @@ -702,7 +702,7 @@ public ServiceFuture getLocalNegativeOffsetLowercaseMaxDateTimeAsync(S * * @return a Single which performs the network request upon subscription. */ - public Single> getLocalNegativeOffsetLowercaseMaxDateTimeWithRestResponseAsync() { + public Single> getLocalNegativeOffsetLowercaseMaxDateTimeWithRestResponseAsync() { return service.getLocalNegativeOffsetLowercaseMaxDateTime(); } @@ -711,43 +711,43 @@ public Single> getLocalNegativeOffsetLowercaseMaxDateTime * * @return a Single which performs the network request upon subscription. */ - public Maybe getLocalNegativeOffsetLowercaseMaxDateTimeAsync() { + public Maybe getLocalNegativeOffsetLowercaseMaxDateTimeAsync() { return getLocalNegativeOffsetLowercaseMaxDateTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Put min datetime value 0001-01-01T00:00:00Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putUtcMinDateTime(@NonNull DateTime datetimeBody) { + public void putUtcMinDateTime(@NonNull OffsetDateTime datetimeBody) { putUtcMinDateTimeAsync(datetimeBody).blockingAwait(); } /** * Put min datetime value 0001-01-01T00:00:00Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putUtcMinDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback) { + public ServiceFuture putUtcMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putUtcMinDateTimeAsync(datetimeBody), serviceCallback); } /** * Put min datetime value 0001-01-01T00:00:00Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putUtcMinDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody) { + public Single putUtcMinDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody) { if (datetimeBody == null) { throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); } @@ -757,11 +757,11 @@ public Single putUtcMinDateTimeWithRestResponseAsync(@NonNull Date /** * Put min datetime value 0001-01-01T00:00:00Z. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable putUtcMinDateTimeAsync(@NonNull DateTime datetimeBody) { + public Completable putUtcMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody) { return putUtcMinDateTimeWithRestResponseAsync(datetimeBody) .toCompletable(); } @@ -771,9 +771,9 @@ public Completable putUtcMinDateTimeAsync(@NonNull DateTime datetimeBody) { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getUtcMinDateTime() { + public OffsetDateTime getUtcMinDateTime() { return getUtcMinDateTimeAsync().blockingGet(); } @@ -784,7 +784,7 @@ public DateTime getUtcMinDateTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getUtcMinDateTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getUtcMinDateTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getUtcMinDateTimeAsync(), serviceCallback); } @@ -793,7 +793,7 @@ public ServiceFuture getUtcMinDateTimeAsync(ServiceCallback * * @return a Single which performs the network request upon subscription. */ - public Single> getUtcMinDateTimeWithRestResponseAsync() { + public Single> getUtcMinDateTimeWithRestResponseAsync() { return service.getUtcMinDateTime(); } @@ -802,43 +802,43 @@ public Single> getUtcMinDateTimeWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getUtcMinDateTimeAsync() { + public Maybe getUtcMinDateTimeAsync() { return getUtcMinDateTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Put min datetime value 0001-01-01T00:00:00+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putLocalPositiveOffsetMinDateTime(@NonNull DateTime datetimeBody) { + public void putLocalPositiveOffsetMinDateTime(@NonNull OffsetDateTime datetimeBody) { putLocalPositiveOffsetMinDateTimeAsync(datetimeBody).blockingAwait(); } /** * Put min datetime value 0001-01-01T00:00:00+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putLocalPositiveOffsetMinDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback) { + public ServiceFuture putLocalPositiveOffsetMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putLocalPositiveOffsetMinDateTimeAsync(datetimeBody), serviceCallback); } /** * Put min datetime value 0001-01-01T00:00:00+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putLocalPositiveOffsetMinDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody) { + public Single putLocalPositiveOffsetMinDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody) { if (datetimeBody == null) { throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); } @@ -848,11 +848,11 @@ public Single putLocalPositiveOffsetMinDateTimeWithRestResponseAsy /** * Put min datetime value 0001-01-01T00:00:00+14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable putLocalPositiveOffsetMinDateTimeAsync(@NonNull DateTime datetimeBody) { + public Completable putLocalPositiveOffsetMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody) { return putLocalPositiveOffsetMinDateTimeWithRestResponseAsync(datetimeBody) .toCompletable(); } @@ -862,9 +862,9 @@ public Completable putLocalPositiveOffsetMinDateTimeAsync(@NonNull DateTime date * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getLocalPositiveOffsetMinDateTime() { + public OffsetDateTime getLocalPositiveOffsetMinDateTime() { return getLocalPositiveOffsetMinDateTimeAsync().blockingGet(); } @@ -875,7 +875,7 @@ public DateTime getLocalPositiveOffsetMinDateTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getLocalPositiveOffsetMinDateTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getLocalPositiveOffsetMinDateTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getLocalPositiveOffsetMinDateTimeAsync(), serviceCallback); } @@ -884,7 +884,7 @@ public ServiceFuture getLocalPositiveOffsetMinDateTimeAsync(ServiceCal * * @return a Single which performs the network request upon subscription. */ - public Single> getLocalPositiveOffsetMinDateTimeWithRestResponseAsync() { + public Single> getLocalPositiveOffsetMinDateTimeWithRestResponseAsync() { return service.getLocalPositiveOffsetMinDateTime(); } @@ -893,43 +893,43 @@ public Single> getLocalPositiveOffsetMinDateTimeWithRestR * * @return a Single which performs the network request upon subscription. */ - public Maybe getLocalPositiveOffsetMinDateTimeAsync() { + public Maybe getLocalPositiveOffsetMinDateTimeAsync() { return getLocalPositiveOffsetMinDateTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Put min datetime value 0001-01-01T00:00:00-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putLocalNegativeOffsetMinDateTime(@NonNull DateTime datetimeBody) { + public void putLocalNegativeOffsetMinDateTime(@NonNull OffsetDateTime datetimeBody) { putLocalNegativeOffsetMinDateTimeAsync(datetimeBody).blockingAwait(); } /** * Put min datetime value 0001-01-01T00:00:00-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putLocalNegativeOffsetMinDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback) { + public ServiceFuture putLocalNegativeOffsetMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putLocalNegativeOffsetMinDateTimeAsync(datetimeBody), serviceCallback); } /** * Put min datetime value 0001-01-01T00:00:00-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putLocalNegativeOffsetMinDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody) { + public Single putLocalNegativeOffsetMinDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody) { if (datetimeBody == null) { throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); } @@ -939,11 +939,11 @@ public Single putLocalNegativeOffsetMinDateTimeWithRestResponseAsy /** * Put min datetime value 0001-01-01T00:00:00-14:00. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable putLocalNegativeOffsetMinDateTimeAsync(@NonNull DateTime datetimeBody) { + public Completable putLocalNegativeOffsetMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody) { return putLocalNegativeOffsetMinDateTimeWithRestResponseAsync(datetimeBody) .toCompletable(); } @@ -953,9 +953,9 @@ public Completable putLocalNegativeOffsetMinDateTimeAsync(@NonNull DateTime date * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getLocalNegativeOffsetMinDateTime() { + public OffsetDateTime getLocalNegativeOffsetMinDateTime() { return getLocalNegativeOffsetMinDateTimeAsync().blockingGet(); } @@ -966,7 +966,7 @@ public DateTime getLocalNegativeOffsetMinDateTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getLocalNegativeOffsetMinDateTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getLocalNegativeOffsetMinDateTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getLocalNegativeOffsetMinDateTimeAsync(), serviceCallback); } @@ -975,7 +975,7 @@ public ServiceFuture getLocalNegativeOffsetMinDateTimeAsync(ServiceCal * * @return a Single which performs the network request upon subscription. */ - public Single> getLocalNegativeOffsetMinDateTimeWithRestResponseAsync() { + public Single> getLocalNegativeOffsetMinDateTimeWithRestResponseAsync() { return service.getLocalNegativeOffsetMinDateTime(); } @@ -984,8 +984,8 @@ public Single> getLocalNegativeOffsetMinDateTimeWithRestR * * @return a Single which performs the network request upon subscription. */ - public Maybe getLocalNegativeOffsetMinDateTimeAsync() { + public Maybe getLocalNegativeOffsetMinDateTimeAsync() { return getLocalNegativeOffsetMinDateTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } } diff --git a/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/Datetimerfc1123s.java b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/Datetimerfc1123s.java index dd89823831..f99f293eca 100644 --- a/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/Datetimerfc1123s.java +++ b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/Datetimerfc1123s.java @@ -19,7 +19,7 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; -import org.joda.time.DateTime; +import java.time.OffsetDateTime; /** * An instance of this class provides access to all the operations defined in @@ -31,9 +31,9 @@ public interface Datetimerfc1123s { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getNull(); + OffsetDateTime getNull(); /** * Get null datetime value. @@ -42,30 +42,30 @@ public interface Datetimerfc1123s { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getNullAsync(ServiceCallback serviceCallback); + ServiceFuture getNullAsync(ServiceCallback serviceCallback); /** * Get null datetime value. * * @return a Single which performs the network request upon subscription. */ - Single> getNullWithRestResponseAsync(); + Single> getNullWithRestResponseAsync(); /** * Get null datetime value. * * @return a Single which performs the network request upon subscription. */ - Maybe getNullAsync(); + Maybe getNullAsync(); /** * Get invalid datetime value. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getInvalid(); + OffsetDateTime getInvalid(); /** * Get invalid datetime value. @@ -74,30 +74,30 @@ public interface Datetimerfc1123s { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getInvalidAsync(ServiceCallback serviceCallback); + ServiceFuture getInvalidAsync(ServiceCallback serviceCallback); /** * Get invalid datetime value. * * @return a Single which performs the network request upon subscription. */ - Single> getInvalidWithRestResponseAsync(); + Single> getInvalidWithRestResponseAsync(); /** * Get invalid datetime value. * * @return a Single which performs the network request upon subscription. */ - Maybe getInvalidAsync(); + Maybe getInvalidAsync(); /** * Get overflow datetime value. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getOverflow(); + OffsetDateTime getOverflow(); /** * Get overflow datetime value. @@ -106,30 +106,30 @@ public interface Datetimerfc1123s { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getOverflowAsync(ServiceCallback serviceCallback); + ServiceFuture getOverflowAsync(ServiceCallback serviceCallback); /** * Get overflow datetime value. * * @return a Single which performs the network request upon subscription. */ - Single> getOverflowWithRestResponseAsync(); + Single> getOverflowWithRestResponseAsync(); /** * Get overflow datetime value. * * @return a Single which performs the network request upon subscription. */ - Maybe getOverflowAsync(); + Maybe getOverflowAsync(); /** * Get underflow datetime value. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getUnderflow(); + OffsetDateTime getUnderflow(); /** * Get underflow datetime value. @@ -138,68 +138,68 @@ public interface Datetimerfc1123s { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getUnderflowAsync(ServiceCallback serviceCallback); + ServiceFuture getUnderflowAsync(ServiceCallback serviceCallback); /** * Get underflow datetime value. * * @return a Single which performs the network request upon subscription. */ - Single> getUnderflowWithRestResponseAsync(); + Single> getUnderflowWithRestResponseAsync(); /** * Get underflow datetime value. * * @return a Single which performs the network request upon subscription. */ - Maybe getUnderflowAsync(); + Maybe getUnderflowAsync(); /** * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putUtcMaxDateTime(@NonNull DateTime datetimeBody); + void putUtcMaxDateTime(@NonNull OffsetDateTime datetimeBody); /** * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putUtcMaxDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback); + ServiceFuture putUtcMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback); /** * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putUtcMaxDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody); + Single putUtcMaxDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody); /** * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putUtcMaxDateTimeAsync(@NonNull DateTime datetimeBody); + Completable putUtcMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody); /** * Get max datetime value fri, 31 dec 9999 23:59:59 gmt. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getUtcLowercaseMaxDateTime(); + OffsetDateTime getUtcLowercaseMaxDateTime(); /** * Get max datetime value fri, 31 dec 9999 23:59:59 gmt. @@ -208,30 +208,30 @@ public interface Datetimerfc1123s { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getUtcLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getUtcLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback); /** * Get max datetime value fri, 31 dec 9999 23:59:59 gmt. * * @return a Single which performs the network request upon subscription. */ - Single> getUtcLowercaseMaxDateTimeWithRestResponseAsync(); + Single> getUtcLowercaseMaxDateTimeWithRestResponseAsync(); /** * Get max datetime value fri, 31 dec 9999 23:59:59 gmt. * * @return a Single which performs the network request upon subscription. */ - Maybe getUtcLowercaseMaxDateTimeAsync(); + Maybe getUtcLowercaseMaxDateTimeAsync(); /** * Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getUtcUppercaseMaxDateTime(); + OffsetDateTime getUtcUppercaseMaxDateTime(); /** * Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT. @@ -240,68 +240,68 @@ public interface Datetimerfc1123s { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getUtcUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getUtcUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback); /** * Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT. * * @return a Single which performs the network request upon subscription. */ - Single> getUtcUppercaseMaxDateTimeWithRestResponseAsync(); + Single> getUtcUppercaseMaxDateTimeWithRestResponseAsync(); /** * Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT. * * @return a Single which performs the network request upon subscription. */ - Maybe getUtcUppercaseMaxDateTimeAsync(); + Maybe getUtcUppercaseMaxDateTimeAsync(); /** * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putUtcMinDateTime(@NonNull DateTime datetimeBody); + void putUtcMinDateTime(@NonNull OffsetDateTime datetimeBody); /** * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putUtcMinDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback); + ServiceFuture putUtcMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback); /** * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putUtcMinDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody); + Single putUtcMinDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody); /** * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putUtcMinDateTimeAsync(@NonNull DateTime datetimeBody); + Completable putUtcMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody); /** * Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getUtcMinDateTime(); + OffsetDateTime getUtcMinDateTime(); /** * Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT. @@ -310,19 +310,19 @@ public interface Datetimerfc1123s { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getUtcMinDateTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getUtcMinDateTimeAsync(ServiceCallback serviceCallback); /** * Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT. * * @return a Single which performs the network request upon subscription. */ - Single> getUtcMinDateTimeWithRestResponseAsync(); + Single> getUtcMinDateTimeWithRestResponseAsync(); /** * Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT. * * @return a Single which performs the network request upon subscription. */ - Maybe getUtcMinDateTimeAsync(); + Maybe getUtcMinDateTimeAsync(); } diff --git a/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/implementation/Datetimerfc1123sImpl.java b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/implementation/Datetimerfc1123sImpl.java index 8388015a35..5de8afe65b 100644 --- a/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/implementation/Datetimerfc1123sImpl.java +++ b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/implementation/Datetimerfc1123sImpl.java @@ -29,7 +29,7 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; -import org.joda.time.DateTime; +import java.time.OffsetDateTime; /** * An instance of this class provides access to all the operations defined in @@ -66,25 +66,25 @@ private interface Datetimerfc1123sService { @ExpectedResponses({200}) @ReturnValueWireType(DateTimeRfc1123.class) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getNull(); + Single> getNull(); @GET("datetimerfc1123/invalid") @ExpectedResponses({200}) @ReturnValueWireType(DateTimeRfc1123.class) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getInvalid(); + Single> getInvalid(); @GET("datetimerfc1123/overflow") @ExpectedResponses({200}) @ReturnValueWireType(DateTimeRfc1123.class) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getOverflow(); + Single> getOverflow(); @GET("datetimerfc1123/underflow") @ExpectedResponses({200}) @ReturnValueWireType(DateTimeRfc1123.class) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getUnderflow(); + Single> getUnderflow(); @PUT("datetimerfc1123/max") @ExpectedResponses({200}) @@ -95,13 +95,13 @@ private interface Datetimerfc1123sService { @ExpectedResponses({200}) @ReturnValueWireType(DateTimeRfc1123.class) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getUtcLowercaseMaxDateTime(); + Single> getUtcLowercaseMaxDateTime(); @GET("datetimerfc1123/max/uppercase") @ExpectedResponses({200}) @ReturnValueWireType(DateTimeRfc1123.class) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getUtcUppercaseMaxDateTime(); + Single> getUtcUppercaseMaxDateTime(); @PUT("datetimerfc1123/min") @ExpectedResponses({200}) @@ -112,7 +112,7 @@ private interface Datetimerfc1123sService { @ExpectedResponses({200}) @ReturnValueWireType(DateTimeRfc1123.class) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getUtcMinDateTime(); + Single> getUtcMinDateTime(); } /** @@ -120,9 +120,9 @@ private interface Datetimerfc1123sService { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getNull() { + public OffsetDateTime getNull() { return getNullAsync().blockingGet(); } @@ -133,7 +133,7 @@ public DateTime getNull() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getNullAsync(ServiceCallback serviceCallback) { + public ServiceFuture getNullAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getNullAsync(), serviceCallback); } @@ -142,7 +142,7 @@ public ServiceFuture getNullAsync(ServiceCallback serviceCal * * @return a Single which performs the network request upon subscription. */ - public Single> getNullWithRestResponseAsync() { + public Single> getNullWithRestResponseAsync() { return service.getNull(); } @@ -151,9 +151,9 @@ public Single> getNullWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getNullAsync() { + public Maybe getNullAsync() { return getNullWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -161,9 +161,9 @@ public Maybe getNullAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getInvalid() { + public OffsetDateTime getInvalid() { return getInvalidAsync().blockingGet(); } @@ -174,7 +174,7 @@ public DateTime getInvalid() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getInvalidAsync(ServiceCallback serviceCallback) { + public ServiceFuture getInvalidAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getInvalidAsync(), serviceCallback); } @@ -183,7 +183,7 @@ public ServiceFuture getInvalidAsync(ServiceCallback service * * @return a Single which performs the network request upon subscription. */ - public Single> getInvalidWithRestResponseAsync() { + public Single> getInvalidWithRestResponseAsync() { return service.getInvalid(); } @@ -192,9 +192,9 @@ public Single> getInvalidWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getInvalidAsync() { + public Maybe getInvalidAsync() { return getInvalidWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -202,9 +202,9 @@ public Maybe getInvalidAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getOverflow() { + public OffsetDateTime getOverflow() { return getOverflowAsync().blockingGet(); } @@ -215,7 +215,7 @@ public DateTime getOverflow() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getOverflowAsync(ServiceCallback serviceCallback) { + public ServiceFuture getOverflowAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getOverflowAsync(), serviceCallback); } @@ -224,7 +224,7 @@ public ServiceFuture getOverflowAsync(ServiceCallback servic * * @return a Single which performs the network request upon subscription. */ - public Single> getOverflowWithRestResponseAsync() { + public Single> getOverflowWithRestResponseAsync() { return service.getOverflow(); } @@ -233,9 +233,9 @@ public Single> getOverflowWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getOverflowAsync() { + public Maybe getOverflowAsync() { return getOverflowWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -243,9 +243,9 @@ public Maybe getOverflowAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getUnderflow() { + public OffsetDateTime getUnderflow() { return getUnderflowAsync().blockingGet(); } @@ -256,7 +256,7 @@ public DateTime getUnderflow() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getUnderflowAsync(ServiceCallback serviceCallback) { + public ServiceFuture getUnderflowAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getUnderflowAsync(), serviceCallback); } @@ -265,7 +265,7 @@ public ServiceFuture getUnderflowAsync(ServiceCallback servi * * @return a Single which performs the network request upon subscription. */ - public Single> getUnderflowWithRestResponseAsync() { + public Single> getUnderflowWithRestResponseAsync() { return service.getUnderflow(); } @@ -274,43 +274,43 @@ public Single> getUnderflowWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getUnderflowAsync() { + public Maybe getUnderflowAsync() { return getUnderflowWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putUtcMaxDateTime(@NonNull DateTime datetimeBody) { + public void putUtcMaxDateTime(@NonNull OffsetDateTime datetimeBody) { putUtcMaxDateTimeAsync(datetimeBody).blockingAwait(); } /** * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putUtcMaxDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback) { + public ServiceFuture putUtcMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putUtcMaxDateTimeAsync(datetimeBody), serviceCallback); } /** * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putUtcMaxDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody) { + public Single putUtcMaxDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody) { if (datetimeBody == null) { throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); } @@ -321,11 +321,11 @@ public Single putUtcMaxDateTimeWithRestResponseAsync(@NonNull Date /** * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable putUtcMaxDateTimeAsync(@NonNull DateTime datetimeBody) { + public Completable putUtcMaxDateTimeAsync(@NonNull OffsetDateTime datetimeBody) { return putUtcMaxDateTimeWithRestResponseAsync(datetimeBody) .toCompletable(); } @@ -335,9 +335,9 @@ public Completable putUtcMaxDateTimeAsync(@NonNull DateTime datetimeBody) { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getUtcLowercaseMaxDateTime() { + public OffsetDateTime getUtcLowercaseMaxDateTime() { return getUtcLowercaseMaxDateTimeAsync().blockingGet(); } @@ -348,7 +348,7 @@ public DateTime getUtcLowercaseMaxDateTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getUtcLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getUtcLowercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getUtcLowercaseMaxDateTimeAsync(), serviceCallback); } @@ -357,7 +357,7 @@ public ServiceFuture getUtcLowercaseMaxDateTimeAsync(ServiceCallback> getUtcLowercaseMaxDateTimeWithRestResponseAsync() { + public Single> getUtcLowercaseMaxDateTimeWithRestResponseAsync() { return service.getUtcLowercaseMaxDateTime(); } @@ -366,9 +366,9 @@ public Single> getUtcLowercaseMaxDateTimeWithRestResponse * * @return a Single which performs the network request upon subscription. */ - public Maybe getUtcLowercaseMaxDateTimeAsync() { + public Maybe getUtcLowercaseMaxDateTimeAsync() { return getUtcLowercaseMaxDateTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -376,9 +376,9 @@ public Maybe getUtcLowercaseMaxDateTimeAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getUtcUppercaseMaxDateTime() { + public OffsetDateTime getUtcUppercaseMaxDateTime() { return getUtcUppercaseMaxDateTimeAsync().blockingGet(); } @@ -389,7 +389,7 @@ public DateTime getUtcUppercaseMaxDateTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getUtcUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getUtcUppercaseMaxDateTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getUtcUppercaseMaxDateTimeAsync(), serviceCallback); } @@ -398,7 +398,7 @@ public ServiceFuture getUtcUppercaseMaxDateTimeAsync(ServiceCallback> getUtcUppercaseMaxDateTimeWithRestResponseAsync() { + public Single> getUtcUppercaseMaxDateTimeWithRestResponseAsync() { return service.getUtcUppercaseMaxDateTime(); } @@ -407,43 +407,43 @@ public Single> getUtcUppercaseMaxDateTimeWithRestResponse * * @return a Single which performs the network request upon subscription. */ - public Maybe getUtcUppercaseMaxDateTimeAsync() { + public Maybe getUtcUppercaseMaxDateTimeAsync() { return getUtcUppercaseMaxDateTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putUtcMinDateTime(@NonNull DateTime datetimeBody) { + public void putUtcMinDateTime(@NonNull OffsetDateTime datetimeBody) { putUtcMinDateTimeAsync(datetimeBody).blockingAwait(); } /** * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putUtcMinDateTimeAsync(@NonNull DateTime datetimeBody, ServiceCallback serviceCallback) { + public ServiceFuture putUtcMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putUtcMinDateTimeAsync(datetimeBody), serviceCallback); } /** * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putUtcMinDateTimeWithRestResponseAsync(@NonNull DateTime datetimeBody) { + public Single putUtcMinDateTimeWithRestResponseAsync(@NonNull OffsetDateTime datetimeBody) { if (datetimeBody == null) { throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); } @@ -454,11 +454,11 @@ public Single putUtcMinDateTimeWithRestResponseAsync(@NonNull Date /** * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. * - * @param datetimeBody the DateTime value. + * @param datetimeBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable putUtcMinDateTimeAsync(@NonNull DateTime datetimeBody) { + public Completable putUtcMinDateTimeAsync(@NonNull OffsetDateTime datetimeBody) { return putUtcMinDateTimeWithRestResponseAsync(datetimeBody) .toCompletable(); } @@ -468,9 +468,9 @@ public Completable putUtcMinDateTimeAsync(@NonNull DateTime datetimeBody) { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getUtcMinDateTime() { + public OffsetDateTime getUtcMinDateTime() { return getUtcMinDateTimeAsync().blockingGet(); } @@ -481,7 +481,7 @@ public DateTime getUtcMinDateTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getUtcMinDateTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getUtcMinDateTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getUtcMinDateTimeAsync(), serviceCallback); } @@ -490,7 +490,7 @@ public ServiceFuture getUtcMinDateTimeAsync(ServiceCallback * * @return a Single which performs the network request upon subscription. */ - public Single> getUtcMinDateTimeWithRestResponseAsync() { + public Single> getUtcMinDateTimeWithRestResponseAsync() { return service.getUtcMinDateTime(); } @@ -499,8 +499,8 @@ public Single> getUtcMinDateTimeWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getUtcMinDateTimeAsync() { + public Maybe getUtcMinDateTimeAsync() { return getUtcMinDateTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } } diff --git a/test/vanilla/src/main/java/fixtures/bodydictionary/Dictionarys.java b/test/vanilla/src/main/java/fixtures/bodydictionary/Dictionarys.java index 6999cd5001..f4289878f1 100644 --- a/test/vanilla/src/main/java/fixtures/bodydictionary/Dictionarys.java +++ b/test/vanilla/src/main/java/fixtures/bodydictionary/Dictionarys.java @@ -20,11 +20,11 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; +import java.time.Duration; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.Period; /** * An instance of this class provides access to all the operations defined in @@ -1204,9 +1204,9 @@ public interface Dictionarys { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Map<String, DateTime> object if successful. + * @return the Map<String, OffsetDateTime> object if successful. */ - Map getDateTimeValid(); + Map getDateTimeValid(); /** * Get date-time dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. @@ -1215,68 +1215,68 @@ public interface Dictionarys { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture> getDateTimeValidAsync(ServiceCallback> serviceCallback); + ServiceFuture> getDateTimeValidAsync(ServiceCallback> serviceCallback); /** * Get date-time dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. * * @return a Single which performs the network request upon subscription. */ - Single>> getDateTimeValidWithRestResponseAsync(); + Single>> getDateTimeValidWithRestResponseAsync(); /** * Get date-time dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. * * @return a Single which performs the network request upon subscription. */ - Maybe> getDateTimeValidAsync(); + Maybe> getDateTimeValidAsync(); /** * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putDateTimeValid(@NonNull Map arrayBody); + void putDateTimeValid(@NonNull Map arrayBody); /** * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putDateTimeValidAsync(@NonNull Map arrayBody, ServiceCallback serviceCallback); + ServiceFuture putDateTimeValidAsync(@NonNull Map arrayBody, ServiceCallback serviceCallback); /** * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putDateTimeValidWithRestResponseAsync(@NonNull Map arrayBody); + Single putDateTimeValidWithRestResponseAsync(@NonNull Map arrayBody); /** * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putDateTimeValidAsync(@NonNull Map arrayBody); + Completable putDateTimeValidAsync(@NonNull Map arrayBody); /** * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": null}. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Map<String, DateTime> object if successful. + * @return the Map<String, OffsetDateTime> object if successful. */ - Map getDateTimeInvalidNull(); + Map getDateTimeInvalidNull(); /** * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": null}. @@ -1285,30 +1285,30 @@ public interface Dictionarys { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture> getDateTimeInvalidNullAsync(ServiceCallback> serviceCallback); + ServiceFuture> getDateTimeInvalidNullAsync(ServiceCallback> serviceCallback); /** * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": null}. * * @return a Single which performs the network request upon subscription. */ - Single>> getDateTimeInvalidNullWithRestResponseAsync(); + Single>> getDateTimeInvalidNullWithRestResponseAsync(); /** * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": null}. * * @return a Single which performs the network request upon subscription. */ - Maybe> getDateTimeInvalidNullAsync(); + Maybe> getDateTimeInvalidNullAsync(); /** * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": "date-time"}. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Map<String, DateTime> object if successful. + * @return the Map<String, OffsetDateTime> object if successful. */ - Map getDateTimeInvalidChars(); + Map getDateTimeInvalidChars(); /** * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": "date-time"}. @@ -1317,30 +1317,30 @@ public interface Dictionarys { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture> getDateTimeInvalidCharsAsync(ServiceCallback> serviceCallback); + ServiceFuture> getDateTimeInvalidCharsAsync(ServiceCallback> serviceCallback); /** * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": "date-time"}. * * @return a Single which performs the network request upon subscription. */ - Single>> getDateTimeInvalidCharsWithRestResponseAsync(); + Single>> getDateTimeInvalidCharsWithRestResponseAsync(); /** * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": "date-time"}. * * @return a Single which performs the network request upon subscription. */ - Maybe> getDateTimeInvalidCharsAsync(); + Maybe> getDateTimeInvalidCharsAsync(); /** * Get date-time-rfc1123 dictionary value {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Map<String, DateTime> object if successful. + * @return the Map<String, OffsetDateTime> object if successful. */ - Map getDateTimeRfc1123Valid(); + Map getDateTimeRfc1123Valid(); /** * Get date-time-rfc1123 dictionary value {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. @@ -1349,68 +1349,68 @@ public interface Dictionarys { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture> getDateTimeRfc1123ValidAsync(ServiceCallback> serviceCallback); + ServiceFuture> getDateTimeRfc1123ValidAsync(ServiceCallback> serviceCallback); /** * Get date-time-rfc1123 dictionary value {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. * * @return a Single which performs the network request upon subscription. */ - Single>> getDateTimeRfc1123ValidWithRestResponseAsync(); + Single>> getDateTimeRfc1123ValidWithRestResponseAsync(); /** * Get date-time-rfc1123 dictionary value {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. * * @return a Single which performs the network request upon subscription. */ - Maybe> getDateTimeRfc1123ValidAsync(); + Maybe> getDateTimeRfc1123ValidAsync(); /** * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putDateTimeRfc1123Valid(@NonNull Map arrayBody); + void putDateTimeRfc1123Valid(@NonNull Map arrayBody); /** * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putDateTimeRfc1123ValidAsync(@NonNull Map arrayBody, ServiceCallback serviceCallback); + ServiceFuture putDateTimeRfc1123ValidAsync(@NonNull Map arrayBody, ServiceCallback serviceCallback); /** * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putDateTimeRfc1123ValidWithRestResponseAsync(@NonNull Map arrayBody); + Single putDateTimeRfc1123ValidWithRestResponseAsync(@NonNull Map arrayBody); /** * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putDateTimeRfc1123ValidAsync(@NonNull Map arrayBody); + Completable putDateTimeRfc1123ValidAsync(@NonNull Map arrayBody); /** * Get duration dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Map<String, Period> object if successful. + * @return the Map<String, Duration> object if successful. */ - Map getDurationValid(); + Map getDurationValid(); /** * Get duration dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. @@ -1419,59 +1419,59 @@ public interface Dictionarys { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture> getDurationValidAsync(ServiceCallback> serviceCallback); + ServiceFuture> getDurationValidAsync(ServiceCallback> serviceCallback); /** * Get duration dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. * * @return a Single which performs the network request upon subscription. */ - Single>> getDurationValidWithRestResponseAsync(); + Single>> getDurationValidWithRestResponseAsync(); /** * Get duration dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. * * @return a Single which performs the network request upon subscription. */ - Maybe> getDurationValidAsync(); + Maybe> getDurationValidAsync(); /** * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. * - * @param arrayBody the Map<String, Period> value. + * @param arrayBody the Map<String, Duration> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putDurationValid(@NonNull Map arrayBody); + void putDurationValid(@NonNull Map arrayBody); /** * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. * - * @param arrayBody the Map<String, Period> value. + * @param arrayBody the Map<String, Duration> value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putDurationValidAsync(@NonNull Map arrayBody, ServiceCallback serviceCallback); + ServiceFuture putDurationValidAsync(@NonNull Map arrayBody, ServiceCallback serviceCallback); /** * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. * - * @param arrayBody the Map<String, Period> value. + * @param arrayBody the Map<String, Duration> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putDurationValidWithRestResponseAsync(@NonNull Map arrayBody); + Single putDurationValidWithRestResponseAsync(@NonNull Map arrayBody); /** * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. * - * @param arrayBody the Map<String, Period> value. + * @param arrayBody the Map<String, Duration> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putDurationValidAsync(@NonNull Map arrayBody); + Completable putDurationValidAsync(@NonNull Map arrayBody); /** * Get byte dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each item encoded in base64. diff --git a/test/vanilla/src/main/java/fixtures/bodydictionary/implementation/DictionarysImpl.java b/test/vanilla/src/main/java/fixtures/bodydictionary/implementation/DictionarysImpl.java index 650d41ff43..3813fd9ce5 100644 --- a/test/vanilla/src/main/java/fixtures/bodydictionary/implementation/DictionarysImpl.java +++ b/test/vanilla/src/main/java/fixtures/bodydictionary/implementation/DictionarysImpl.java @@ -32,13 +32,13 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; +import java.time.Duration; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.Period; /** * An instance of this class provides access to all the operations defined in @@ -249,28 +249,28 @@ private interface DictionarysService { @GET("dictionary/prim/date-time/valid") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single>> getDateTimeValid(); + Single>> getDateTimeValid(); @PUT("dictionary/prim/date-time/valid") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single putDateTimeValid(@BodyParam("application/json; charset=utf-8") Map arrayBody); + Single putDateTimeValid(@BodyParam("application/json; charset=utf-8") Map arrayBody); @GET("dictionary/prim/date-time/invalidnull") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single>> getDateTimeInvalidNull(); + Single>> getDateTimeInvalidNull(); @GET("dictionary/prim/date-time/invalidchars") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single>> getDateTimeInvalidChars(); + Single>> getDateTimeInvalidChars(); @GET("dictionary/prim/date-time-rfc1123/valid") @ExpectedResponses({200}) @ReturnValueWireType(DateTimeRfc1123.class) @UnexpectedResponseExceptionType(ErrorException.class) - Single>> getDateTimeRfc1123Valid(); + Single>> getDateTimeRfc1123Valid(); @PUT("dictionary/prim/date-time-rfc1123/valid") @ExpectedResponses({200}) @@ -280,12 +280,12 @@ private interface DictionarysService { @GET("dictionary/prim/duration/valid") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single>> getDurationValid(); + Single>> getDurationValid(); @PUT("dictionary/prim/duration/valid") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single putDurationValid(@BodyParam("application/json; charset=utf-8") Map arrayBody); + Single putDurationValid(@BodyParam("application/json; charset=utf-8") Map arrayBody); @GET("dictionary/prim/byte/valid") @ExpectedResponses({200}) @@ -1919,9 +1919,9 @@ public Maybe> getDateInvalidCharsAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Map<String, DateTime> object if successful. + * @return the Map<String, OffsetDateTime> object if successful. */ - public Map getDateTimeValid() { + public Map getDateTimeValid() { return getDateTimeValidAsync().blockingGet(); } @@ -1932,7 +1932,7 @@ public Map getDateTimeValid() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture> getDateTimeValidAsync(ServiceCallback> serviceCallback) { + public ServiceFuture> getDateTimeValidAsync(ServiceCallback> serviceCallback) { return ServiceFuture.fromBody(getDateTimeValidAsync(), serviceCallback); } @@ -1941,7 +1941,7 @@ public ServiceFuture> getDateTimeValidAsync(ServiceCallbac * * @return a Single which performs the network request upon subscription. */ - public Single>> getDateTimeValidWithRestResponseAsync() { + public Single>> getDateTimeValidWithRestResponseAsync() { return service.getDateTimeValid(); } @@ -1950,43 +1950,43 @@ public Single>> getDateTimeValidWithRestRespo * * @return a Single which performs the network request upon subscription. */ - public Maybe> getDateTimeValidAsync() { + public Maybe> getDateTimeValidAsync() { return getDateTimeValidWithRestResponseAsync() - .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putDateTimeValid(@NonNull Map arrayBody) { + public void putDateTimeValid(@NonNull Map arrayBody) { putDateTimeValidAsync(arrayBody).blockingAwait(); } /** * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putDateTimeValidAsync(@NonNull Map arrayBody, ServiceCallback serviceCallback) { + public ServiceFuture putDateTimeValidAsync(@NonNull Map arrayBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putDateTimeValidAsync(arrayBody), serviceCallback); } /** * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putDateTimeValidWithRestResponseAsync(@NonNull Map arrayBody) { + public Single putDateTimeValidWithRestResponseAsync(@NonNull Map arrayBody) { if (arrayBody == null) { throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); } @@ -1997,11 +1997,11 @@ public Single putDateTimeValidWithRestResponseAsync(@NonNull Map arrayBody) { + public Completable putDateTimeValidAsync(@NonNull Map arrayBody) { return putDateTimeValidWithRestResponseAsync(arrayBody) .toCompletable(); } @@ -2011,9 +2011,9 @@ public Completable putDateTimeValidAsync(@NonNull Map arrayBod * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Map<String, DateTime> object if successful. + * @return the Map<String, OffsetDateTime> object if successful. */ - public Map getDateTimeInvalidNull() { + public Map getDateTimeInvalidNull() { return getDateTimeInvalidNullAsync().blockingGet(); } @@ -2024,7 +2024,7 @@ public Map getDateTimeInvalidNull() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture> getDateTimeInvalidNullAsync(ServiceCallback> serviceCallback) { + public ServiceFuture> getDateTimeInvalidNullAsync(ServiceCallback> serviceCallback) { return ServiceFuture.fromBody(getDateTimeInvalidNullAsync(), serviceCallback); } @@ -2033,7 +2033,7 @@ public ServiceFuture> getDateTimeInvalidNullAsync(ServiceC * * @return a Single which performs the network request upon subscription. */ - public Single>> getDateTimeInvalidNullWithRestResponseAsync() { + public Single>> getDateTimeInvalidNullWithRestResponseAsync() { return service.getDateTimeInvalidNull(); } @@ -2042,9 +2042,9 @@ public Single>> getDateTimeInvalidNullWithRes * * @return a Single which performs the network request upon subscription. */ - public Maybe> getDateTimeInvalidNullAsync() { + public Maybe> getDateTimeInvalidNullAsync() { return getDateTimeInvalidNullWithRestResponseAsync() - .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -2052,9 +2052,9 @@ public Maybe> getDateTimeInvalidNullAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Map<String, DateTime> object if successful. + * @return the Map<String, OffsetDateTime> object if successful. */ - public Map getDateTimeInvalidChars() { + public Map getDateTimeInvalidChars() { return getDateTimeInvalidCharsAsync().blockingGet(); } @@ -2065,7 +2065,7 @@ public Map getDateTimeInvalidChars() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture> getDateTimeInvalidCharsAsync(ServiceCallback> serviceCallback) { + public ServiceFuture> getDateTimeInvalidCharsAsync(ServiceCallback> serviceCallback) { return ServiceFuture.fromBody(getDateTimeInvalidCharsAsync(), serviceCallback); } @@ -2074,7 +2074,7 @@ public ServiceFuture> getDateTimeInvalidCharsAsync(Service * * @return a Single which performs the network request upon subscription. */ - public Single>> getDateTimeInvalidCharsWithRestResponseAsync() { + public Single>> getDateTimeInvalidCharsWithRestResponseAsync() { return service.getDateTimeInvalidChars(); } @@ -2083,9 +2083,9 @@ public Single>> getDateTimeInvalidCharsWithRe * * @return a Single which performs the network request upon subscription. */ - public Maybe> getDateTimeInvalidCharsAsync() { + public Maybe> getDateTimeInvalidCharsAsync() { return getDateTimeInvalidCharsWithRestResponseAsync() - .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -2093,9 +2093,9 @@ public Maybe> getDateTimeInvalidCharsAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Map<String, DateTime> object if successful. + * @return the Map<String, OffsetDateTime> object if successful. */ - public Map getDateTimeRfc1123Valid() { + public Map getDateTimeRfc1123Valid() { return getDateTimeRfc1123ValidAsync().blockingGet(); } @@ -2106,7 +2106,7 @@ public Map getDateTimeRfc1123Valid() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture> getDateTimeRfc1123ValidAsync(ServiceCallback> serviceCallback) { + public ServiceFuture> getDateTimeRfc1123ValidAsync(ServiceCallback> serviceCallback) { return ServiceFuture.fromBody(getDateTimeRfc1123ValidAsync(), serviceCallback); } @@ -2115,7 +2115,7 @@ public ServiceFuture> getDateTimeRfc1123ValidAsync(Service * * @return a Single which performs the network request upon subscription. */ - public Single>> getDateTimeRfc1123ValidWithRestResponseAsync() { + public Single>> getDateTimeRfc1123ValidWithRestResponseAsync() { return service.getDateTimeRfc1123Valid(); } @@ -2124,49 +2124,49 @@ public Single>> getDateTimeRfc1123ValidWithRe * * @return a Single which performs the network request upon subscription. */ - public Maybe> getDateTimeRfc1123ValidAsync() { + public Maybe> getDateTimeRfc1123ValidAsync() { return getDateTimeRfc1123ValidWithRestResponseAsync() - .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putDateTimeRfc1123Valid(@NonNull Map arrayBody) { + public void putDateTimeRfc1123Valid(@NonNull Map arrayBody) { putDateTimeRfc1123ValidAsync(arrayBody).blockingAwait(); } /** * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putDateTimeRfc1123ValidAsync(@NonNull Map arrayBody, ServiceCallback serviceCallback) { + public ServiceFuture putDateTimeRfc1123ValidAsync(@NonNull Map arrayBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putDateTimeRfc1123ValidAsync(arrayBody), serviceCallback); } /** * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putDateTimeRfc1123ValidWithRestResponseAsync(@NonNull Map arrayBody) { + public Single putDateTimeRfc1123ValidWithRestResponseAsync(@NonNull Map arrayBody) { if (arrayBody == null) { throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); } Validator.validate(arrayBody); Map arrayBodyConverted = new HashMap(); - for (Map.Entry entry : arrayBody.entrySet()) { + for (Map.Entry entry : arrayBody.entrySet()) { DateTimeRfc1123 value = new DateTimeRfc1123(entry.getValue()); arrayBodyConverted.put(entry.getKey(), value); } @@ -2176,11 +2176,11 @@ public Single putDateTimeRfc1123ValidWithRestResponseAsync(@NonNul /** * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. * - * @param arrayBody the Map<String, DateTime> value. + * @param arrayBody the Map<String, OffsetDateTime> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable putDateTimeRfc1123ValidAsync(@NonNull Map arrayBody) { + public Completable putDateTimeRfc1123ValidAsync(@NonNull Map arrayBody) { return putDateTimeRfc1123ValidWithRestResponseAsync(arrayBody) .toCompletable(); } @@ -2190,9 +2190,9 @@ public Completable putDateTimeRfc1123ValidAsync(@NonNull Map a * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Map<String, Period> object if successful. + * @return the Map<String, Duration> object if successful. */ - public Map getDurationValid() { + public Map getDurationValid() { return getDurationValidAsync().blockingGet(); } @@ -2203,7 +2203,7 @@ public Map getDurationValid() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture> getDurationValidAsync(ServiceCallback> serviceCallback) { + public ServiceFuture> getDurationValidAsync(ServiceCallback> serviceCallback) { return ServiceFuture.fromBody(getDurationValidAsync(), serviceCallback); } @@ -2212,7 +2212,7 @@ public ServiceFuture> getDurationValidAsync(ServiceCallback< * * @return a Single which performs the network request upon subscription. */ - public Single>> getDurationValidWithRestResponseAsync() { + public Single>> getDurationValidWithRestResponseAsync() { return service.getDurationValid(); } @@ -2221,43 +2221,43 @@ public Single>> getDurationValidWithRestRespons * * @return a Single which performs the network request upon subscription. */ - public Maybe> getDurationValidAsync() { + public Maybe> getDurationValidAsync() { return getDurationValidWithRestResponseAsync() - .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse> res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. * - * @param arrayBody the Map<String, Period> value. + * @param arrayBody the Map<String, Duration> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putDurationValid(@NonNull Map arrayBody) { + public void putDurationValid(@NonNull Map arrayBody) { putDurationValidAsync(arrayBody).blockingAwait(); } /** * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. * - * @param arrayBody the Map<String, Period> value. + * @param arrayBody the Map<String, Duration> value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putDurationValidAsync(@NonNull Map arrayBody, ServiceCallback serviceCallback) { + public ServiceFuture putDurationValidAsync(@NonNull Map arrayBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putDurationValidAsync(arrayBody), serviceCallback); } /** * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. * - * @param arrayBody the Map<String, Period> value. + * @param arrayBody the Map<String, Duration> value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putDurationValidWithRestResponseAsync(@NonNull Map arrayBody) { + public Single putDurationValidWithRestResponseAsync(@NonNull Map arrayBody) { if (arrayBody == null) { throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); } @@ -2268,11 +2268,11 @@ public Single putDurationValidWithRestResponseAsync(@NonNull Map arrayBody) { + public Completable putDurationValidAsync(@NonNull Map arrayBody) { return putDurationValidWithRestResponseAsync(arrayBody) .toCompletable(); } diff --git a/test/vanilla/src/main/java/fixtures/bodyduration/Durations.java b/test/vanilla/src/main/java/fixtures/bodyduration/Durations.java index 6caddd374c..a46ff49a75 100644 --- a/test/vanilla/src/main/java/fixtures/bodyduration/Durations.java +++ b/test/vanilla/src/main/java/fixtures/bodyduration/Durations.java @@ -19,7 +19,7 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; -import org.joda.time.Period; +import java.time.Duration; /** * An instance of this class provides access to all the operations defined in @@ -31,9 +31,9 @@ public interface Durations { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Period object if successful. + * @return the Duration object if successful. */ - Period getNull(); + Duration getNull(); /** * Get null duration value. @@ -42,68 +42,68 @@ public interface Durations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getNullAsync(ServiceCallback serviceCallback); + ServiceFuture getNullAsync(ServiceCallback serviceCallback); /** * Get null duration value. * * @return a Single which performs the network request upon subscription. */ - Single> getNullWithRestResponseAsync(); + Single> getNullWithRestResponseAsync(); /** * Get null duration value. * * @return a Single which performs the network request upon subscription. */ - Maybe getNullAsync(); + Maybe getNullAsync(); /** * Put a positive duration value. * - * @param durationBody the Period value. + * @param durationBody the Duration value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putPositiveDuration(@NonNull Period durationBody); + void putPositiveDuration(@NonNull Duration durationBody); /** * Put a positive duration value. * - * @param durationBody the Period value. + * @param durationBody the Duration value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putPositiveDurationAsync(@NonNull Period durationBody, ServiceCallback serviceCallback); + ServiceFuture putPositiveDurationAsync(@NonNull Duration durationBody, ServiceCallback serviceCallback); /** * Put a positive duration value. * - * @param durationBody the Period value. + * @param durationBody the Duration value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putPositiveDurationWithRestResponseAsync(@NonNull Period durationBody); + Single putPositiveDurationWithRestResponseAsync(@NonNull Duration durationBody); /** * Put a positive duration value. * - * @param durationBody the Period value. + * @param durationBody the Duration value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putPositiveDurationAsync(@NonNull Period durationBody); + Completable putPositiveDurationAsync(@NonNull Duration durationBody); /** * Get a positive duration value. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Period object if successful. + * @return the Duration object if successful. */ - Period getPositiveDuration(); + Duration getPositiveDuration(); /** * Get a positive duration value. @@ -112,30 +112,30 @@ public interface Durations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getPositiveDurationAsync(ServiceCallback serviceCallback); + ServiceFuture getPositiveDurationAsync(ServiceCallback serviceCallback); /** * Get a positive duration value. * * @return a Single which performs the network request upon subscription. */ - Single> getPositiveDurationWithRestResponseAsync(); + Single> getPositiveDurationWithRestResponseAsync(); /** * Get a positive duration value. * * @return a Single which performs the network request upon subscription. */ - Maybe getPositiveDurationAsync(); + Maybe getPositiveDurationAsync(); /** * Get an invalid duration value. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Period object if successful. + * @return the Duration object if successful. */ - Period getInvalid(); + Duration getInvalid(); /** * Get an invalid duration value. @@ -144,19 +144,19 @@ public interface Durations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getInvalidAsync(ServiceCallback serviceCallback); + ServiceFuture getInvalidAsync(ServiceCallback serviceCallback); /** * Get an invalid duration value. * * @return a Single which performs the network request upon subscription. */ - Single> getInvalidWithRestResponseAsync(); + Single> getInvalidWithRestResponseAsync(); /** * Get an invalid duration value. * * @return a Single which performs the network request upon subscription. */ - Maybe getInvalidAsync(); + Maybe getInvalidAsync(); } diff --git a/test/vanilla/src/main/java/fixtures/bodyduration/implementation/DurationsImpl.java b/test/vanilla/src/main/java/fixtures/bodyduration/implementation/DurationsImpl.java index 936990efc6..246cd052b0 100644 --- a/test/vanilla/src/main/java/fixtures/bodyduration/implementation/DurationsImpl.java +++ b/test/vanilla/src/main/java/fixtures/bodyduration/implementation/DurationsImpl.java @@ -27,7 +27,7 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; -import org.joda.time.Period; +import java.time.Duration; /** * An instance of this class provides access to all the operations defined in @@ -63,22 +63,22 @@ private interface DurationsService { @GET("duration/null") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getNull(); + Single> getNull(); @PUT("duration/positiveduration") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single putPositiveDuration(@BodyParam("application/json; charset=utf-8") Period durationBody); + Single putPositiveDuration(@BodyParam("application/json; charset=utf-8") Duration durationBody); @GET("duration/positiveduration") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getPositiveDuration(); + Single> getPositiveDuration(); @GET("duration/invalid") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getInvalid(); + Single> getInvalid(); } /** @@ -86,9 +86,9 @@ private interface DurationsService { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Period object if successful. + * @return the Duration object if successful. */ - public Period getNull() { + public Duration getNull() { return getNullAsync().blockingGet(); } @@ -99,7 +99,7 @@ public Period getNull() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getNullAsync(ServiceCallback serviceCallback) { + public ServiceFuture getNullAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getNullAsync(), serviceCallback); } @@ -108,7 +108,7 @@ public ServiceFuture getNullAsync(ServiceCallback serviceCallbac * * @return a Single which performs the network request upon subscription. */ - public Single> getNullWithRestResponseAsync() { + public Single> getNullWithRestResponseAsync() { return service.getNull(); } @@ -117,43 +117,43 @@ public Single> getNullWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getNullAsync() { + public Maybe getNullAsync() { return getNullWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Put a positive duration value. * - * @param durationBody the Period value. + * @param durationBody the Duration value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putPositiveDuration(@NonNull Period durationBody) { + public void putPositiveDuration(@NonNull Duration durationBody) { putPositiveDurationAsync(durationBody).blockingAwait(); } /** * Put a positive duration value. * - * @param durationBody the Period value. + * @param durationBody the Duration value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putPositiveDurationAsync(@NonNull Period durationBody, ServiceCallback serviceCallback) { + public ServiceFuture putPositiveDurationAsync(@NonNull Duration durationBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putPositiveDurationAsync(durationBody), serviceCallback); } /** * Put a positive duration value. * - * @param durationBody the Period value. + * @param durationBody the Duration value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putPositiveDurationWithRestResponseAsync(@NonNull Period durationBody) { + public Single putPositiveDurationWithRestResponseAsync(@NonNull Duration durationBody) { if (durationBody == null) { throw new IllegalArgumentException("Parameter durationBody is required and cannot be null."); } @@ -163,11 +163,11 @@ public Single putPositiveDurationWithRestResponseAsync(@NonNull Pe /** * Put a positive duration value. * - * @param durationBody the Period value. + * @param durationBody the Duration value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable putPositiveDurationAsync(@NonNull Period durationBody) { + public Completable putPositiveDurationAsync(@NonNull Duration durationBody) { return putPositiveDurationWithRestResponseAsync(durationBody) .toCompletable(); } @@ -177,9 +177,9 @@ public Completable putPositiveDurationAsync(@NonNull Period durationBody) { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Period object if successful. + * @return the Duration object if successful. */ - public Period getPositiveDuration() { + public Duration getPositiveDuration() { return getPositiveDurationAsync().blockingGet(); } @@ -190,7 +190,7 @@ public Period getPositiveDuration() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getPositiveDurationAsync(ServiceCallback serviceCallback) { + public ServiceFuture getPositiveDurationAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getPositiveDurationAsync(), serviceCallback); } @@ -199,7 +199,7 @@ public ServiceFuture getPositiveDurationAsync(ServiceCallback se * * @return a Single which performs the network request upon subscription. */ - public Single> getPositiveDurationWithRestResponseAsync() { + public Single> getPositiveDurationWithRestResponseAsync() { return service.getPositiveDuration(); } @@ -208,9 +208,9 @@ public Single> getPositiveDurationWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getPositiveDurationAsync() { + public Maybe getPositiveDurationAsync() { return getPositiveDurationWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -218,9 +218,9 @@ public Maybe getPositiveDurationAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Period object if successful. + * @return the Duration object if successful. */ - public Period getInvalid() { + public Duration getInvalid() { return getInvalidAsync().blockingGet(); } @@ -231,7 +231,7 @@ public Period getInvalid() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getInvalidAsync(ServiceCallback serviceCallback) { + public ServiceFuture getInvalidAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getInvalidAsync(), serviceCallback); } @@ -240,7 +240,7 @@ public ServiceFuture getInvalidAsync(ServiceCallback serviceCall * * @return a Single which performs the network request upon subscription. */ - public Single> getInvalidWithRestResponseAsync() { + public Single> getInvalidWithRestResponseAsync() { return service.getInvalid(); } @@ -249,8 +249,8 @@ public Single> getInvalidWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getInvalidAsync() { + public Maybe getInvalidAsync() { return getInvalidWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } } diff --git a/test/vanilla/src/main/java/fixtures/bodyinteger/Ints.java b/test/vanilla/src/main/java/fixtures/bodyinteger/Ints.java index 2707e7e03d..58eceaf4f1 100644 --- a/test/vanilla/src/main/java/fixtures/bodyinteger/Ints.java +++ b/test/vanilla/src/main/java/fixtures/bodyinteger/Ints.java @@ -19,7 +19,7 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; -import org.joda.time.DateTime; +import java.time.OffsetDateTime; /** * An instance of this class provides access to all the operations defined in @@ -375,9 +375,9 @@ public interface Ints { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getUnixTime(); + OffsetDateTime getUnixTime(); /** * Get datetime encoded as Unix time value. @@ -386,68 +386,68 @@ public interface Ints { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getUnixTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getUnixTimeAsync(ServiceCallback serviceCallback); /** * Get datetime encoded as Unix time value. * * @return a Single which performs the network request upon subscription. */ - Single> getUnixTimeWithRestResponseAsync(); + Single> getUnixTimeWithRestResponseAsync(); /** * Get datetime encoded as Unix time value. * * @return a Single which performs the network request upon subscription. */ - Maybe getUnixTimeAsync(); + Maybe getUnixTimeAsync(); /** * Put datetime encoded as Unix time. * - * @param intBody the DateTime value. + * @param intBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void putUnixTimeDate(@NonNull DateTime intBody); + void putUnixTimeDate(@NonNull OffsetDateTime intBody); /** * Put datetime encoded as Unix time. * - * @param intBody the DateTime value. + * @param intBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture putUnixTimeDateAsync(@NonNull DateTime intBody, ServiceCallback serviceCallback); + ServiceFuture putUnixTimeDateAsync(@NonNull OffsetDateTime intBody, ServiceCallback serviceCallback); /** * Put datetime encoded as Unix time. * - * @param intBody the DateTime value. + * @param intBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single putUnixTimeDateWithRestResponseAsync(@NonNull DateTime intBody); + Single putUnixTimeDateWithRestResponseAsync(@NonNull OffsetDateTime intBody); /** * Put datetime encoded as Unix time. * - * @param intBody the DateTime value. + * @param intBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable putUnixTimeDateAsync(@NonNull DateTime intBody); + Completable putUnixTimeDateAsync(@NonNull OffsetDateTime intBody); /** * Get invalid Unix time value. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getInvalidUnixTime(); + OffsetDateTime getInvalidUnixTime(); /** * Get invalid Unix time value. @@ -456,30 +456,30 @@ public interface Ints { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getInvalidUnixTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getInvalidUnixTimeAsync(ServiceCallback serviceCallback); /** * Get invalid Unix time value. * * @return a Single which performs the network request upon subscription. */ - Single> getInvalidUnixTimeWithRestResponseAsync(); + Single> getInvalidUnixTimeWithRestResponseAsync(); /** * Get invalid Unix time value. * * @return a Single which performs the network request upon subscription. */ - Maybe getInvalidUnixTimeAsync(); + Maybe getInvalidUnixTimeAsync(); /** * Get null Unix time value. * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - DateTime getNullUnixTime(); + OffsetDateTime getNullUnixTime(); /** * Get null Unix time value. @@ -488,19 +488,19 @@ public interface Ints { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture getNullUnixTimeAsync(ServiceCallback serviceCallback); + ServiceFuture getNullUnixTimeAsync(ServiceCallback serviceCallback); /** * Get null Unix time value. * * @return a Single which performs the network request upon subscription. */ - Single> getNullUnixTimeWithRestResponseAsync(); + Single> getNullUnixTimeWithRestResponseAsync(); /** * Get null Unix time value. * * @return a Single which performs the network request upon subscription. */ - Maybe getNullUnixTimeAsync(); + Maybe getNullUnixTimeAsync(); } diff --git a/test/vanilla/src/main/java/fixtures/bodyinteger/implementation/IntsImpl.java b/test/vanilla/src/main/java/fixtures/bodyinteger/implementation/IntsImpl.java index 45fd1086be..e07fa443bf 100644 --- a/test/vanilla/src/main/java/fixtures/bodyinteger/implementation/IntsImpl.java +++ b/test/vanilla/src/main/java/fixtures/bodyinteger/implementation/IntsImpl.java @@ -29,8 +29,7 @@ import io.reactivex.Maybe; import io.reactivex.Single; import io.reactivex.annotations.NonNull; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; +import java.time.OffsetDateTime; /** * An instance of this class provides access to all the operations defined in @@ -117,7 +116,7 @@ private interface IntsService { @ExpectedResponses({200}) @ReturnValueWireType(UnixTime.class) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getUnixTime(); + Single> getUnixTime(); @PUT("int/unixtime") @ExpectedResponses({200}) @@ -128,13 +127,13 @@ private interface IntsService { @ExpectedResponses({200}) @ReturnValueWireType(UnixTime.class) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getInvalidUnixTime(); + Single> getInvalidUnixTime(); @GET("int/nullunixtime") @ExpectedResponses({200}) @ReturnValueWireType(UnixTime.class) @UnexpectedResponseExceptionType(ErrorException.class) - Single> getNullUnixTime(); + Single> getNullUnixTime(); } /** @@ -576,9 +575,9 @@ public Completable putMin64Async(@NonNull long intBody) { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getUnixTime() { + public OffsetDateTime getUnixTime() { return getUnixTimeAsync().blockingGet(); } @@ -589,7 +588,7 @@ public DateTime getUnixTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getUnixTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getUnixTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getUnixTimeAsync(), serviceCallback); } @@ -598,7 +597,7 @@ public ServiceFuture getUnixTimeAsync(ServiceCallback servic * * @return a Single which performs the network request upon subscription. */ - public Single> getUnixTimeWithRestResponseAsync() { + public Single> getUnixTimeWithRestResponseAsync() { return service.getUnixTime(); } @@ -607,55 +606,55 @@ public Single> getUnixTimeWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getUnixTimeAsync() { + public Maybe getUnixTimeAsync() { return getUnixTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** * Put datetime encoded as Unix time. * - * @param intBody the DateTime value. + * @param intBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void putUnixTimeDate(@NonNull DateTime intBody) { + public void putUnixTimeDate(@NonNull OffsetDateTime intBody) { putUnixTimeDateAsync(intBody).blockingAwait(); } /** * Put datetime encoded as Unix time. * - * @param intBody the DateTime value. + * @param intBody the OffsetDateTime value. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture putUnixTimeDateAsync(@NonNull DateTime intBody, ServiceCallback serviceCallback) { + public ServiceFuture putUnixTimeDateAsync(@NonNull OffsetDateTime intBody, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(putUnixTimeDateAsync(intBody), serviceCallback); } /** * Put datetime encoded as Unix time. * - * @param intBody the DateTime value. + * @param intBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single putUnixTimeDateWithRestResponseAsync(@NonNull DateTime intBody) { - Long intBodyConverted = intBody.toDateTime(DateTimeZone.UTC).getMillis() / 1000; + public Single putUnixTimeDateWithRestResponseAsync(@NonNull OffsetDateTime intBody) { + Long intBodyConverted = intBody.toInstant().getEpochSecond(); return service.putUnixTimeDate(intBodyConverted); } /** * Put datetime encoded as Unix time. * - * @param intBody the DateTime value. + * @param intBody the OffsetDateTime value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable putUnixTimeDateAsync(@NonNull DateTime intBody) { + public Completable putUnixTimeDateAsync(@NonNull OffsetDateTime intBody) { return putUnixTimeDateWithRestResponseAsync(intBody) .toCompletable(); } @@ -665,9 +664,9 @@ public Completable putUnixTimeDateAsync(@NonNull DateTime intBody) { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getInvalidUnixTime() { + public OffsetDateTime getInvalidUnixTime() { return getInvalidUnixTimeAsync().blockingGet(); } @@ -678,7 +677,7 @@ public DateTime getInvalidUnixTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getInvalidUnixTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getInvalidUnixTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getInvalidUnixTimeAsync(), serviceCallback); } @@ -687,7 +686,7 @@ public ServiceFuture getInvalidUnixTimeAsync(ServiceCallback * * @return a Single which performs the network request upon subscription. */ - public Single> getInvalidUnixTimeWithRestResponseAsync() { + public Single> getInvalidUnixTimeWithRestResponseAsync() { return service.getInvalidUnixTime(); } @@ -696,9 +695,9 @@ public Single> getInvalidUnixTimeWithRestResponseAsync() * * @return a Single which performs the network request upon subscription. */ - public Maybe getInvalidUnixTimeAsync() { + public Maybe getInvalidUnixTimeAsync() { return getInvalidUnixTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } /** @@ -706,9 +705,9 @@ public Maybe getInvalidUnixTimeAsync() { * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DateTime object if successful. + * @return the OffsetDateTime object if successful. */ - public DateTime getNullUnixTime() { + public OffsetDateTime getNullUnixTime() { return getNullUnixTimeAsync().blockingGet(); } @@ -719,7 +718,7 @@ public DateTime getNullUnixTime() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture getNullUnixTimeAsync(ServiceCallback serviceCallback) { + public ServiceFuture getNullUnixTimeAsync(ServiceCallback serviceCallback) { return ServiceFuture.fromBody(getNullUnixTimeAsync(), serviceCallback); } @@ -728,7 +727,7 @@ public ServiceFuture getNullUnixTimeAsync(ServiceCallback se * * @return a Single which performs the network request upon subscription. */ - public Single> getNullUnixTimeWithRestResponseAsync() { + public Single> getNullUnixTimeWithRestResponseAsync() { return service.getNullUnixTime(); } @@ -737,8 +736,8 @@ public Single> getNullUnixTimeWithRestResponseAsync() { * * @return a Single which performs the network request upon subscription. */ - public Maybe getNullUnixTimeAsync() { + public Maybe getNullUnixTimeAsync() { return getNullUnixTimeWithRestResponseAsync() - .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); + .flatMapMaybe((BodyResponse res) -> res.body() == null ? Maybe.empty() : Maybe.just(res.body())); } } diff --git a/test/vanilla/src/main/java/fixtures/header/Headers.java b/test/vanilla/src/main/java/fixtures/header/Headers.java index 05d5b17719..4298ac0ef2 100644 --- a/test/vanilla/src/main/java/fixtures/header/Headers.java +++ b/test/vanilla/src/main/java/fixtures/header/Headers.java @@ -32,9 +32,9 @@ import io.reactivex.Completable; import io.reactivex.Single; import io.reactivex.annotations.NonNull; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.Period; +import java.time.Duration; +import java.time.LocalDate; +import java.time.OffsetDateTime; /** * An instance of this class provides access to all the operations defined in @@ -786,7 +786,7 @@ public interface Headers { * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void paramDatetime(@NonNull String scenario, @NonNull DateTime value); + void paramDatetime(@NonNull String scenario, @NonNull OffsetDateTime value); /** * Send a post request with header values "scenario": "valid", "value": "2010-01-01T12:34:56Z" or "scenario": "min", "value": "0001-01-01T00:00:00Z". @@ -797,7 +797,7 @@ public interface Headers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture paramDatetimeAsync(@NonNull String scenario, @NonNull DateTime value, ServiceCallback serviceCallback); + ServiceFuture paramDatetimeAsync(@NonNull String scenario, @NonNull OffsetDateTime value, ServiceCallback serviceCallback); /** * Send a post request with header values "scenario": "valid", "value": "2010-01-01T12:34:56Z" or "scenario": "min", "value": "0001-01-01T00:00:00Z". @@ -807,7 +807,7 @@ public interface Headers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single paramDatetimeWithRestResponseAsync(@NonNull String scenario, @NonNull DateTime value); + Single paramDatetimeWithRestResponseAsync(@NonNull String scenario, @NonNull OffsetDateTime value); /** * Send a post request with header values "scenario": "valid", "value": "2010-01-01T12:34:56Z" or "scenario": "min", "value": "0001-01-01T00:00:00Z". @@ -817,7 +817,7 @@ public interface Headers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable paramDatetimeAsync(@NonNull String scenario, @NonNull DateTime value); + Completable paramDatetimeAsync(@NonNull String scenario, @NonNull OffsetDateTime value); /** * Get a response with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z". @@ -904,7 +904,7 @@ public interface Headers { * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void paramDatetimeRfc1123(@NonNull String scenario, DateTime value); + void paramDatetimeRfc1123(@NonNull String scenario, OffsetDateTime value); /** * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". @@ -915,7 +915,7 @@ public interface Headers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture paramDatetimeRfc1123Async(@NonNull String scenario, DateTime value, ServiceCallback serviceCallback); + ServiceFuture paramDatetimeRfc1123Async(@NonNull String scenario, OffsetDateTime value, ServiceCallback serviceCallback); /** * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". @@ -925,7 +925,7 @@ public interface Headers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single paramDatetimeRfc1123WithRestResponseAsync(@NonNull String scenario, DateTime value); + Single paramDatetimeRfc1123WithRestResponseAsync(@NonNull String scenario, OffsetDateTime value); /** * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". @@ -935,7 +935,7 @@ public interface Headers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable paramDatetimeRfc1123Async(@NonNull String scenario, DateTime value); + Completable paramDatetimeRfc1123Async(@NonNull String scenario, OffsetDateTime value); /** * Get a response with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT". @@ -984,7 +984,7 @@ public interface Headers { * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void paramDuration(@NonNull String scenario, @NonNull Period value); + void paramDuration(@NonNull String scenario, @NonNull Duration value); /** * Send a post request with header values "scenario": "valid", "value": "P123DT22H14M12.011S". @@ -995,7 +995,7 @@ public interface Headers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture paramDurationAsync(@NonNull String scenario, @NonNull Period value, ServiceCallback serviceCallback); + ServiceFuture paramDurationAsync(@NonNull String scenario, @NonNull Duration value, ServiceCallback serviceCallback); /** * Send a post request with header values "scenario": "valid", "value": "P123DT22H14M12.011S". @@ -1005,7 +1005,7 @@ public interface Headers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single paramDurationWithRestResponseAsync(@NonNull String scenario, @NonNull Period value); + Single paramDurationWithRestResponseAsync(@NonNull String scenario, @NonNull Duration value); /** * Send a post request with header values "scenario": "valid", "value": "P123DT22H14M12.011S". @@ -1015,7 +1015,7 @@ public interface Headers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable paramDurationAsync(@NonNull String scenario, @NonNull Period value); + Completable paramDurationAsync(@NonNull String scenario, @NonNull Duration value); /** * Get a response with header values "P123DT22H14M12.011S". diff --git a/test/vanilla/src/main/java/fixtures/header/implementation/HeadersImpl.java b/test/vanilla/src/main/java/fixtures/header/implementation/HeadersImpl.java index 382d689f97..2ac1aeeb5f 100644 --- a/test/vanilla/src/main/java/fixtures/header/implementation/HeadersImpl.java +++ b/test/vanilla/src/main/java/fixtures/header/implementation/HeadersImpl.java @@ -40,10 +40,10 @@ import io.reactivex.Completable; import io.reactivex.Single; import io.reactivex.annotations.NonNull; +import java.time.Duration; +import java.time.LocalDate; +import java.time.OffsetDateTime; import org.apache.commons.codec.binary.Base64; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.Period; /** * An instance of this class provides access to all the operations defined in @@ -169,7 +169,7 @@ private interface HeadersService { @POST("header/param/prim/datetime") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single paramDatetime(@HeaderParam("scenario") String scenario, @HeaderParam("value") DateTime value); + Single paramDatetime(@HeaderParam("scenario") String scenario, @HeaderParam("value") OffsetDateTime value); @POST("header/response/prim/datetime") @ExpectedResponses({200}) @@ -189,7 +189,7 @@ private interface HeadersService { @POST("header/param/prim/duration") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single paramDuration(@HeaderParam("scenario") String scenario, @HeaderParam("value") Period value); + Single paramDuration(@HeaderParam("scenario") String scenario, @HeaderParam("value") Duration value); @POST("header/response/prim/duration") @ExpectedResponses({200}) @@ -1193,7 +1193,7 @@ public Completable responseDateAsync(@NonNull String scenario) { * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void paramDatetime(@NonNull String scenario, @NonNull DateTime value) { + public void paramDatetime(@NonNull String scenario, @NonNull OffsetDateTime value) { paramDatetimeAsync(scenario, value).blockingAwait(); } @@ -1206,7 +1206,7 @@ public void paramDatetime(@NonNull String scenario, @NonNull DateTime value) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture paramDatetimeAsync(@NonNull String scenario, @NonNull DateTime value, ServiceCallback serviceCallback) { + public ServiceFuture paramDatetimeAsync(@NonNull String scenario, @NonNull OffsetDateTime value, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(paramDatetimeAsync(scenario, value), serviceCallback); } @@ -1218,7 +1218,7 @@ public ServiceFuture paramDatetimeAsync(@NonNull String scenario, @NonNull * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single paramDatetimeWithRestResponseAsync(@NonNull String scenario, @NonNull DateTime value) { + public Single paramDatetimeWithRestResponseAsync(@NonNull String scenario, @NonNull OffsetDateTime value) { if (scenario == null) { throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); } @@ -1236,7 +1236,7 @@ public Single paramDatetimeWithRestResponseAsync(@NonNull String s * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable paramDatetimeAsync(@NonNull String scenario, @NonNull DateTime value) { + public Completable paramDatetimeAsync(@NonNull String scenario, @NonNull OffsetDateTime value) { return paramDatetimeWithRestResponseAsync(scenario, value) .toCompletable(); } @@ -1326,7 +1326,7 @@ public Single paramDatetimeRfc1123WithRestResponseAsync(@NonNull S if (scenario == null) { throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); } - final DateTime value = null; + final OffsetDateTime value = null; DateTimeRfc1123 valueConverted = null; if (value != null) { valueConverted = new DateTimeRfc1123(value); @@ -1355,7 +1355,7 @@ public Completable paramDatetimeRfc1123Async(@NonNull String scenario) { * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void paramDatetimeRfc1123(@NonNull String scenario, DateTime value) { + public void paramDatetimeRfc1123(@NonNull String scenario, OffsetDateTime value) { paramDatetimeRfc1123Async(scenario, value).blockingAwait(); } @@ -1368,7 +1368,7 @@ public void paramDatetimeRfc1123(@NonNull String scenario, DateTime value) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture paramDatetimeRfc1123Async(@NonNull String scenario, DateTime value, ServiceCallback serviceCallback) { + public ServiceFuture paramDatetimeRfc1123Async(@NonNull String scenario, OffsetDateTime value, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(paramDatetimeRfc1123Async(scenario, value), serviceCallback); } @@ -1380,7 +1380,7 @@ public ServiceFuture paramDatetimeRfc1123Async(@NonNull String scenario, D * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single paramDatetimeRfc1123WithRestResponseAsync(@NonNull String scenario, DateTime value) { + public Single paramDatetimeRfc1123WithRestResponseAsync(@NonNull String scenario, OffsetDateTime value) { if (scenario == null) { throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); } @@ -1399,7 +1399,7 @@ public Single paramDatetimeRfc1123WithRestResponseAsync(@NonNull S * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable paramDatetimeRfc1123Async(@NonNull String scenario, DateTime value) { + public Completable paramDatetimeRfc1123Async(@NonNull String scenario, OffsetDateTime value) { return paramDatetimeRfc1123WithRestResponseAsync(scenario, value) .toCompletable(); } @@ -1463,7 +1463,7 @@ public Completable responseDatetimeRfc1123Async(@NonNull String scenario) { * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void paramDuration(@NonNull String scenario, @NonNull Period value) { + public void paramDuration(@NonNull String scenario, @NonNull Duration value) { paramDurationAsync(scenario, value).blockingAwait(); } @@ -1476,7 +1476,7 @@ public void paramDuration(@NonNull String scenario, @NonNull Period value) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture paramDurationAsync(@NonNull String scenario, @NonNull Period value, ServiceCallback serviceCallback) { + public ServiceFuture paramDurationAsync(@NonNull String scenario, @NonNull Duration value, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(paramDurationAsync(scenario, value), serviceCallback); } @@ -1488,7 +1488,7 @@ public ServiceFuture paramDurationAsync(@NonNull String scenario, @NonNull * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single paramDurationWithRestResponseAsync(@NonNull String scenario, @NonNull Period value) { + public Single paramDurationWithRestResponseAsync(@NonNull String scenario, @NonNull Duration value) { if (scenario == null) { throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); } @@ -1506,7 +1506,7 @@ public Single paramDurationWithRestResponseAsync(@NonNull String s * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable paramDurationAsync(@NonNull String scenario, @NonNull Period value) { + public Completable paramDurationAsync(@NonNull String scenario, @NonNull Duration value) { return paramDurationWithRestResponseAsync(scenario, value) .toCompletable(); } diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDateHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDateHeaders.java index fa19ba1b90..6fab2e4923 100644 --- a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDateHeaders.java +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDateHeaders.java @@ -11,7 +11,7 @@ package fixtures.header.models; import com.fasterxml.jackson.annotation.JsonProperty; -import org.joda.time.LocalDate; +import java.time.LocalDate; /** * Defines headers for responseDate operation. diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDatetimeHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDatetimeHeaders.java index 7b7b5e86c4..b9e73f4c13 100644 --- a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDatetimeHeaders.java +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDatetimeHeaders.java @@ -11,7 +11,7 @@ package fixtures.header.models; import com.fasterxml.jackson.annotation.JsonProperty; -import org.joda.time.DateTime; +import java.time.OffsetDateTime; /** * Defines headers for responseDatetime operation. @@ -22,14 +22,14 @@ public final class HeaderResponseDatetimeHeaders { * "0001-01-01T00:00:00Z". */ @JsonProperty(value = "value") - private DateTime value; + private OffsetDateTime value; /** * Get the value value. * * @return the value value. */ - public DateTime value() { + public OffsetDateTime value() { return this.value; } @@ -39,7 +39,7 @@ public DateTime value() { * @param value the value value to set. * @return the HeaderResponseDatetimeHeaders object itself. */ - public HeaderResponseDatetimeHeaders withValue(DateTime value) { + public HeaderResponseDatetimeHeaders withValue(OffsetDateTime value) { this.value = value; return this; } diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDatetimeRfc1123Headers.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDatetimeRfc1123Headers.java index 9273472827..d7efa3737b 100644 --- a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDatetimeRfc1123Headers.java +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDatetimeRfc1123Headers.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.v2.DateTimeRfc1123; -import org.joda.time.DateTime; +import java.time.OffsetDateTime; /** * Defines headers for responseDatetimeRfc1123 operation. @@ -30,7 +30,7 @@ public final class HeaderResponseDatetimeRfc1123Headers { * * @return the value value. */ - public DateTime value() { + public OffsetDateTime value() { if (this.value == null) { return null; } @@ -43,7 +43,7 @@ public DateTime value() { * @param value the value value to set. * @return the HeaderResponseDatetimeRfc1123Headers object itself. */ - public HeaderResponseDatetimeRfc1123Headers withValue(DateTime value) { + public HeaderResponseDatetimeRfc1123Headers withValue(OffsetDateTime value) { if (value == null) { this.value = null; } else { diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDurationHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDurationHeaders.java index 183a5bdd22..7bdad458fe 100644 --- a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDurationHeaders.java +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDurationHeaders.java @@ -11,7 +11,7 @@ package fixtures.header.models; import com.fasterxml.jackson.annotation.JsonProperty; -import org.joda.time.Period; +import java.time.Duration; /** * Defines headers for responseDuration operation. @@ -21,14 +21,14 @@ public final class HeaderResponseDurationHeaders { * response with header values "P123DT22H14M12.011S". */ @JsonProperty(value = "value") - private Period value; + private Duration value; /** * Get the value value. * * @return the value value. */ - public Period value() { + public Duration value() { return this.value; } @@ -38,7 +38,7 @@ public Period value() { * @param value the value value to set. * @return the HeaderResponseDurationHeaders object itself. */ - public HeaderResponseDurationHeaders withValue(Period value) { + public HeaderResponseDurationHeaders withValue(Duration value) { this.value = value; return this; } diff --git a/test/vanilla/src/main/java/fixtures/url/Paths.java b/test/vanilla/src/main/java/fixtures/url/Paths.java index 0c22f97649..c0cd04c5b6 100644 --- a/test/vanilla/src/main/java/fixtures/url/Paths.java +++ b/test/vanilla/src/main/java/fixtures/url/Paths.java @@ -18,9 +18,9 @@ import io.reactivex.Completable; import io.reactivex.Single; import io.reactivex.annotations.NonNull; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.List; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; /** * An instance of this class provides access to all the operations defined in @@ -759,7 +759,7 @@ public interface Paths { * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void dateTimeNull(@NonNull DateTime dateTimePath); + void dateTimeNull(@NonNull OffsetDateTime dateTimePath); /** * Get null as date-time, should be disallowed or throw depending on representation of date-time. @@ -769,7 +769,7 @@ public interface Paths { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture dateTimeNullAsync(@NonNull DateTime dateTimePath, ServiceCallback serviceCallback); + ServiceFuture dateTimeNullAsync(@NonNull OffsetDateTime dateTimePath, ServiceCallback serviceCallback); /** * Get null as date-time, should be disallowed or throw depending on representation of date-time. @@ -778,7 +778,7 @@ public interface Paths { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single dateTimeNullWithRestResponseAsync(@NonNull DateTime dateTimePath); + Single dateTimeNullWithRestResponseAsync(@NonNull OffsetDateTime dateTimePath); /** * Get null as date-time, should be disallowed or throw depending on representation of date-time. @@ -787,7 +787,7 @@ public interface Paths { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable dateTimeNullAsync(@NonNull DateTime dateTimePath); + Completable dateTimeNullAsync(@NonNull OffsetDateTime dateTimePath); /** * Get 'lorem' encoded value as 'bG9yZW0' (base64url). @@ -873,7 +873,7 @@ public interface Paths { * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void unixTimeUrl(@NonNull DateTime unixTimeUrlPath); + void unixTimeUrl(@NonNull OffsetDateTime unixTimeUrlPath); /** * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). @@ -883,7 +883,7 @@ public interface Paths { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture unixTimeUrlAsync(@NonNull DateTime unixTimeUrlPath, ServiceCallback serviceCallback); + ServiceFuture unixTimeUrlAsync(@NonNull OffsetDateTime unixTimeUrlPath, ServiceCallback serviceCallback); /** * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). @@ -892,7 +892,7 @@ public interface Paths { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single unixTimeUrlWithRestResponseAsync(@NonNull DateTime unixTimeUrlPath); + Single unixTimeUrlWithRestResponseAsync(@NonNull OffsetDateTime unixTimeUrlPath); /** * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). @@ -901,5 +901,5 @@ public interface Paths { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable unixTimeUrlAsync(@NonNull DateTime unixTimeUrlPath); + Completable unixTimeUrlAsync(@NonNull OffsetDateTime unixTimeUrlPath); } diff --git a/test/vanilla/src/main/java/fixtures/url/Queries.java b/test/vanilla/src/main/java/fixtures/url/Queries.java index 919ad7de02..2d2ceb69a1 100644 --- a/test/vanilla/src/main/java/fixtures/url/Queries.java +++ b/test/vanilla/src/main/java/fixtures/url/Queries.java @@ -17,9 +17,9 @@ import fixtures.url.models.UriColor; import io.reactivex.Completable; import io.reactivex.Single; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.List; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; /** * An instance of this class provides access to all the operations defined in @@ -1320,7 +1320,7 @@ public interface Queries { * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void dateTimeNull(DateTime dateTimeQuery); + void dateTimeNull(OffsetDateTime dateTimeQuery); /** * Get null as date-time, should result in no query parameters in uri. @@ -1330,7 +1330,7 @@ public interface Queries { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - ServiceFuture dateTimeNullAsync(DateTime dateTimeQuery, ServiceCallback serviceCallback); + ServiceFuture dateTimeNullAsync(OffsetDateTime dateTimeQuery, ServiceCallback serviceCallback); /** * Get null as date-time, should result in no query parameters in uri. @@ -1339,7 +1339,7 @@ public interface Queries { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Single dateTimeNullWithRestResponseAsync(DateTime dateTimeQuery); + Single dateTimeNullWithRestResponseAsync(OffsetDateTime dateTimeQuery); /** * Get null as date-time, should result in no query parameters in uri. @@ -1348,7 +1348,7 @@ public interface Queries { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - Completable dateTimeNullAsync(DateTime dateTimeQuery); + Completable dateTimeNullAsync(OffsetDateTime dateTimeQuery); /** * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. diff --git a/test/vanilla/src/main/java/fixtures/url/implementation/PathsImpl.java b/test/vanilla/src/main/java/fixtures/url/implementation/PathsImpl.java index bccbe3b567..271f70e196 100644 --- a/test/vanilla/src/main/java/fixtures/url/implementation/PathsImpl.java +++ b/test/vanilla/src/main/java/fixtures/url/implementation/PathsImpl.java @@ -28,12 +28,11 @@ import io.reactivex.Completable; import io.reactivex.Single; import io.reactivex.annotations.NonNull; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import org.apache.commons.codec.binary.Base64; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.joda.time.LocalDate; /** * An instance of this class provides access to all the operations defined in @@ -174,12 +173,12 @@ private interface PathsService { @GET("paths/datetime/2012-01-01T01%3A01%3A01Z/{dateTimePath}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single dateTimeValid(@PathParam("dateTimePath") DateTime dateTimePath); + Single dateTimeValid(@PathParam("dateTimePath") OffsetDateTime dateTimePath); @GET("paths/datetime/null/{dateTimePath}") @ExpectedResponses({400}) @UnexpectedResponseExceptionType(ErrorException.class) - Single dateTimeNull(@PathParam("dateTimePath") DateTime dateTimePath); + Single dateTimeNull(@PathParam("dateTimePath") OffsetDateTime dateTimePath); @GET("paths/string/bG9yZW0/{base64UrlPath}") @ExpectedResponses({200}) @@ -1142,7 +1141,7 @@ public ServiceFuture dateTimeValidAsync(ServiceCallback serviceCallb * @return a Single which performs the network request upon subscription. */ public Single dateTimeValidWithRestResponseAsync() { - final DateTime dateTimePath = DateTime.parse("2012-01-01T01:01:01Z"); + final OffsetDateTime dateTimePath = OffsetDateTime.parse("2012-01-01T01:01:01Z"); return service.dateTimeValid(dateTimePath); } @@ -1164,7 +1163,7 @@ public Completable dateTimeValidAsync() { * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void dateTimeNull(@NonNull DateTime dateTimePath) { + public void dateTimeNull(@NonNull OffsetDateTime dateTimePath) { dateTimeNullAsync(dateTimePath).blockingAwait(); } @@ -1176,7 +1175,7 @@ public void dateTimeNull(@NonNull DateTime dateTimePath) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture dateTimeNullAsync(@NonNull DateTime dateTimePath, ServiceCallback serviceCallback) { + public ServiceFuture dateTimeNullAsync(@NonNull OffsetDateTime dateTimePath, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(dateTimeNullAsync(dateTimePath), serviceCallback); } @@ -1187,7 +1186,7 @@ public ServiceFuture dateTimeNullAsync(@NonNull DateTime dateTimePath, Ser * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single dateTimeNullWithRestResponseAsync(@NonNull DateTime dateTimePath) { + public Single dateTimeNullWithRestResponseAsync(@NonNull OffsetDateTime dateTimePath) { if (dateTimePath == null) { throw new IllegalArgumentException("Parameter dateTimePath is required and cannot be null."); } @@ -1201,7 +1200,7 @@ public Single dateTimeNullWithRestResponseAsync(@NonNull DateTime * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable dateTimeNullAsync(@NonNull DateTime dateTimePath) { + public Completable dateTimeNullAsync(@NonNull OffsetDateTime dateTimePath) { return dateTimeNullWithRestResponseAsync(dateTimePath) .toCompletable(); } @@ -1317,7 +1316,7 @@ public Completable arrayCsvInPathAsync(@NonNull List arrayPath) { * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void unixTimeUrl(@NonNull DateTime unixTimeUrlPath) { + public void unixTimeUrl(@NonNull OffsetDateTime unixTimeUrlPath) { unixTimeUrlAsync(unixTimeUrlPath).blockingAwait(); } @@ -1329,7 +1328,7 @@ public void unixTimeUrl(@NonNull DateTime unixTimeUrlPath) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture unixTimeUrlAsync(@NonNull DateTime unixTimeUrlPath, ServiceCallback serviceCallback) { + public ServiceFuture unixTimeUrlAsync(@NonNull OffsetDateTime unixTimeUrlPath, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(unixTimeUrlAsync(unixTimeUrlPath), serviceCallback); } @@ -1340,8 +1339,8 @@ public ServiceFuture unixTimeUrlAsync(@NonNull DateTime unixTimeUrlPath, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single unixTimeUrlWithRestResponseAsync(@NonNull DateTime unixTimeUrlPath) { - Long unixTimeUrlPathConverted = unixTimeUrlPath.toDateTime(DateTimeZone.UTC).getMillis() / 1000; + public Single unixTimeUrlWithRestResponseAsync(@NonNull OffsetDateTime unixTimeUrlPath) { + Long unixTimeUrlPathConverted = unixTimeUrlPath.toInstant().getEpochSecond(); return service.unixTimeUrl(unixTimeUrlPathConverted); } @@ -1352,7 +1351,7 @@ public Single unixTimeUrlWithRestResponseAsync(@NonNull DateTime u * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable unixTimeUrlAsync(@NonNull DateTime unixTimeUrlPath) { + public Completable unixTimeUrlAsync(@NonNull OffsetDateTime unixTimeUrlPath) { return unixTimeUrlWithRestResponseAsync(unixTimeUrlPath) .toCompletable(); } diff --git a/test/vanilla/src/main/java/fixtures/url/implementation/QueriesImpl.java b/test/vanilla/src/main/java/fixtures/url/implementation/QueriesImpl.java index ce65836393..1269107901 100644 --- a/test/vanilla/src/main/java/fixtures/url/implementation/QueriesImpl.java +++ b/test/vanilla/src/main/java/fixtures/url/implementation/QueriesImpl.java @@ -26,11 +26,11 @@ import fixtures.url.models.UriColor; import io.reactivex.Completable; import io.reactivex.Single; +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import org.apache.commons.codec.binary.Base64; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; /** * An instance of this class provides access to all the operations defined in @@ -196,12 +196,12 @@ private interface QueriesService { @GET("queries/datetime/2012-01-01T01%3A01%3A01Z") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single dateTimeValid(@QueryParam("dateTimeQuery") DateTime dateTimeQuery); + Single dateTimeValid(@QueryParam("dateTimeQuery") OffsetDateTime dateTimeQuery); @GET("queries/datetime/null") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorException.class) - Single dateTimeNull(@QueryParam("dateTimeQuery") DateTime dateTimeQuery); + Single dateTimeNull(@QueryParam("dateTimeQuery") OffsetDateTime dateTimeQuery); @GET("queries/array/csv/string/valid") @ExpectedResponses({200}) @@ -1849,7 +1849,7 @@ public ServiceFuture dateTimeValidAsync(ServiceCallback serviceCallb * @return a Single which performs the network request upon subscription. */ public Single dateTimeValidWithRestResponseAsync() { - final DateTime dateTimeQuery = DateTime.parse("2012-01-01T01:01:01Z"); + final OffsetDateTime dateTimeQuery = OffsetDateTime.parse("2012-01-01T01:01:01Z"); return service.dateTimeValid(dateTimeQuery); } @@ -1890,7 +1890,7 @@ public ServiceFuture dateTimeNullAsync(ServiceCallback serviceCallba * @return a Single which performs the network request upon subscription. */ public Single dateTimeNullWithRestResponseAsync() { - final DateTime dateTimeQuery = null; + final OffsetDateTime dateTimeQuery = null; return service.dateTimeNull(dateTimeQuery); } @@ -1912,7 +1912,7 @@ public Completable dateTimeNullAsync() { * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - public void dateTimeNull(DateTime dateTimeQuery) { + public void dateTimeNull(OffsetDateTime dateTimeQuery) { dateTimeNullAsync(dateTimeQuery).blockingAwait(); } @@ -1924,7 +1924,7 @@ public void dateTimeNull(DateTime dateTimeQuery) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a ServiceFuture which will be completed with the result of the network request. */ - public ServiceFuture dateTimeNullAsync(DateTime dateTimeQuery, ServiceCallback serviceCallback) { + public ServiceFuture dateTimeNullAsync(OffsetDateTime dateTimeQuery, ServiceCallback serviceCallback) { return ServiceFuture.fromBody(dateTimeNullAsync(dateTimeQuery), serviceCallback); } @@ -1935,7 +1935,7 @@ public ServiceFuture dateTimeNullAsync(DateTime dateTimeQuery, ServiceCall * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Single dateTimeNullWithRestResponseAsync(DateTime dateTimeQuery) { + public Single dateTimeNullWithRestResponseAsync(OffsetDateTime dateTimeQuery) { return service.dateTimeNull(dateTimeQuery); } @@ -1946,7 +1946,7 @@ public Single dateTimeNullWithRestResponseAsync(DateTime dateTimeQ * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Single which performs the network request upon subscription. */ - public Completable dateTimeNullAsync(DateTime dateTimeQuery) { + public Completable dateTimeNullAsync(OffsetDateTime dateTimeQuery) { return dateTimeNullWithRestResponseAsync(dateTimeQuery) .toCompletable(); } diff --git a/test/vanilla/src/test/java/fixtures/bodyarray/ArrayTests.java b/test/vanilla/src/test/java/fixtures/bodyarray/ArrayTests.java index e61c754dd3..6fd49e3ba1 100644 --- a/test/vanilla/src/test/java/fixtures/bodyarray/ArrayTests.java +++ b/test/vanilla/src/test/java/fixtures/bodyarray/ArrayTests.java @@ -1,16 +1,15 @@ package fixtures.bodyarray; +import com.fasterxml.jackson.core.io.JsonEOFException; import fixtures.bodyarray.implementation.AutoRestSwaggerBATArrayServiceImpl; -import fixtures.bodyarray.models.ErrorException; import fixtures.bodyarray.models.Product; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.joda.time.LocalDate; -import org.joda.time.Period; -import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import java.time.Duration; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -18,8 +17,7 @@ import java.util.Map; import java.util.UUID; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; public class ArrayTests { private static AutoRestSwaggerBATArrayService client; @@ -30,379 +28,368 @@ public static void setup() { } @Test - public void getNull() throws Exception { - Assert.assertNull(client.arrays().getNull()); + public void getNull() { + assertNull(client.arrays().getNull()); } @Test - public void getInvalid() throws Exception { + public void getInvalid() { try { - List result = client.arrays().getInvalid(); - Assert.assertTrue(false); + client.arrays().getInvalid(); + fail(); } catch (RuntimeException exception) { // expected - Assert.assertTrue(exception.getMessage().contains("HTTP response has a malformed body")); + assertEquals(JsonEOFException.class, exception.getCause().getClass()); + assertTrue(exception.getMessage().contains("HTTP response has a malformed body")); } } @Test - public void getEmpty() throws Exception { + public void getEmpty() { List result = client.arrays().getEmpty(); - Assert.assertEquals(0, result.size()); + assertEquals(0, result.size()); } @Test - public void putEmpty() throws Exception { - client.arrays().putEmpty(new ArrayList()); + public void putEmpty() { + client.arrays().putEmpty(new ArrayList<>()); } @Test - public void getBooleanTfft() throws Exception { + public void getBooleanTfft() { List result = client.arrays().getBooleanTfft(); - Object[] expected = new Boolean[] {true, false, false, true}; - Assert.assertArrayEquals(expected, result.toArray()); + Boolean[] expected = new Boolean[] {true, false, false, true}; + assertArrayEquals(expected, result.toArray()); } @Test - public void putBooleanTfft() throws Exception { + public void putBooleanTfft() { client.arrays().putBooleanTfft(Arrays.asList(true, false, false, true)); } @Test - public void getBooleanInvalidNull() throws Exception { - try { - List result = client.arrays().getBooleanInvalidNull(); - } catch (ErrorException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); - } + public void getBooleanInvalidNull() { + final List result = client.arrays().getBooleanInvalidNull(); + final Boolean[] expected = new Boolean[] { true, null, false }; + assertArrayEquals(expected, result.toArray()); } @Test - public void getBooleanInvalidString() throws Exception { + public void getBooleanInvalidString() { try { - List result = client.arrays().getBooleanInvalidString(); + client.arrays().getBooleanInvalidString(); + fail(); } catch (RuntimeException ex) { // expected - Assert.assertTrue(ex.getMessage().contains("only \"true\" or \"false\" recognized")); + assertTrue(ex.getMessage().contains("only \"true\" or \"false\" recognized")); } } @Test - public void getIntegerValid() throws Exception { + public void getIntegerValid() { List result = client.arrays().getIntegerValid(); - Object[] expected = new Integer[] {1, -1, 3, 300}; - Assert.assertArrayEquals(expected, result.toArray()); + Integer[] expected = new Integer[] {1, -1, 3, 300}; + assertArrayEquals(expected, result.toArray()); } @Test - public void putIntegerValid() throws Exception { + public void putIntegerValid() { client.arrays().putIntegerValid(Arrays.asList(1, -1, 3, 300)); } @Test - public void getIntInvalidNull() throws Exception { - try { - List result = client.arrays().getIntInvalidNull(); - } catch (ErrorException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); - } + public void getIntInvalidNull() { + final List result = client.arrays().getIntInvalidNull(); + final Integer[] expected = new Integer[] { 1, null, 0 }; + assertArrayEquals(expected, result.toArray()); } @Test - public void getIntInvalidString() throws Exception { + public void getIntInvalidString() { try { - List result = client.arrays().getIntInvalidString(); + client.arrays().getIntInvalidString(); + fail(); } catch (RuntimeException ex) { // expected - Assert.assertTrue(ex.getMessage().contains("not a valid Integer value")); + assertTrue(ex.getMessage().contains("not a valid Integer value")); } } @Test - public void getLongValid() throws Exception { + public void getLongValid() { List result = client.arrays().getLongValid(); Object[] expected = new Long[] {1L, -1L, 3L, 300L}; - Assert.assertArrayEquals(expected, result.toArray()); + assertArrayEquals(expected, result.toArray()); } @Test - public void putLongValid() throws Exception { + public void putLongValid() { client.arrays().putLongValid(Arrays.asList(1L, -1L, 3L, 300L)); } @Test - public void getLongInvalidNull() throws Exception { - try { - List result = client.arrays().getLongInvalidNull(); - } catch (ErrorException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); - } + public void getLongInvalidNull() { + final List result = client.arrays().getLongInvalidNull(); + final Long[] expected = new Long[] { 1L, null, 0L }; + assertArrayEquals(expected, result.toArray()); } @Test - public void getLongInvalidString() throws Exception { + public void getLongInvalidString() { try { - List result = client.arrays().getLongInvalidString(); + client.arrays().getLongInvalidString(); + fail(); } catch (RuntimeException ex) { // expected - Assert.assertTrue(ex.getMessage().contains("not a valid Long value")); + assertTrue(ex.getMessage().contains("not a valid Long value")); } } @Test - public void getFloatValid() throws Exception { + public void getFloatValid() { List result = client.arrays().getFloatValid(); Object[] expected = new Double[] {0d, -0.01, -1.2e20}; - Assert.assertArrayEquals(expected, result.toArray()); + assertArrayEquals(expected, result.toArray()); } @Test - public void putFloatValid() throws Exception { + public void putFloatValid() { client.arrays().putFloatValid(Arrays.asList(0d, -0.01d, -1.2e20d)); } @Test - public void getFloatInvalidNull() throws Exception { - try { - List result = client.arrays().getFloatInvalidNull(); - } catch (ErrorException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); - } + public void getFloatInvalidNull() { + final List result = client.arrays().getFloatInvalidNull(); + final Double[] expected = new Double[] { 0.0, null, -1.2E20 }; + assertArrayEquals(expected, result.toArray()); } @Test - public void getFloatInvalidString() throws Exception { + public void getFloatInvalidString() { try { - List result = client.arrays().getFloatInvalidString(); + client.arrays().getFloatInvalidString(); + fail(); } catch (RuntimeException ex) { // expected - Assert.assertTrue(ex.getMessage().contains("not a valid Double value")); + assertTrue(ex.getMessage().contains("not a valid Double value")); } } @Test - public void getDoubleValid() throws Exception { + public void getDoubleValid() { List result = client.arrays().getDoubleValid(); Object[] expected = new Double[] {0d, -0.01, -1.2e20}; - Assert.assertArrayEquals(expected, result.toArray()); + assertArrayEquals(expected, result.toArray()); } @Test - public void putDoubleValid() throws Exception { + public void putDoubleValid() { client.arrays().putDoubleValid(Arrays.asList(0d, -0.01d, -1.2e20d)); } @Test - public void getDoubleInvalidNull() throws Exception { - try { - List result = client.arrays().getDoubleInvalidNull(); - } catch (ErrorException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); - } + public void getDoubleInvalidNull() { + final List result = client.arrays().getDoubleInvalidNull(); + final Double[] expected = new Double[] { 0.0, null, -1.2E20 }; + assertArrayEquals(expected, result.toArray()); } @Test - public void getDoubleInvalidString() throws Exception { + public void getDoubleInvalidString() { try { - List result = client.arrays().getDoubleInvalidString(); + client.arrays().getDoubleInvalidString(); + fail(); } catch (RuntimeException ex) { // expected - Assert.assertTrue(ex.getMessage().contains("not a valid Double value")); + assertTrue(ex.getMessage().contains("not a valid Double value")); } } @Test - public void getStringValid() throws Exception { + public void getStringValid() { List result = client.arrays().getStringValid(); - Object[] expected = new String[] {"foo1", "foo2", "foo3"}; - Assert.assertArrayEquals(expected, result.toArray()); + String[] expected = new String[] {"foo1", "foo2", "foo3"}; + assertArrayEquals(expected, result.toArray()); } @Test - public void putStringValid() throws Exception { + public void putStringValid() { client.arrays().putStringValid(Arrays.asList("foo1", "foo2", "foo3")); } @Test - public void getStringWithNull() throws Exception { - try { - List result = client.arrays().getStringWithNull(); - } catch (ErrorException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); - } + public void getStringWithNull() { + final List result = client.arrays().getStringWithNull(); + final String[] expected = new String[] { "foo", null, "foo2" }; + assertArrayEquals(expected, result.toArray()); } @Test - public void getStringWithInvalid() throws Exception { - try { - List result = client.arrays().getStringWithInvalid(); - } catch (ErrorException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("InvalidFormatException")); - } + public void getStringWithInvalid() { + final List result = client.arrays().getStringWithInvalid(); + final String[] expected = new String[] { "foo", "123", "foo2" }; + assertArrayEquals(expected, result.toArray()); } @Test - public void getUuidValid() throws Exception { + public void getUuidValid() { List result = client.arrays().getUuidValid(); - Object[] expected = new UUID[] {UUID.fromString("6dcc7237-45fe-45c4-8a6b-3a8a3f625652"), - UUID.fromString("d1399005-30f7-40d6-8da6-dd7c89ad34db"), - UUID.fromString("f42f6aa1-a5bc-4ddf-907e-5f915de43205")}; - Assert.assertArrayEquals(expected, result.toArray()); + UUID[] expected = new UUID[] {UUID.fromString("6dcc7237-45fe-45c4-8a6b-3a8a3f625652"), + UUID.fromString("d1399005-30f7-40d6-8da6-dd7c89ad34db"), + UUID.fromString("f42f6aa1-a5bc-4ddf-907e-5f915de43205")}; + assertArrayEquals(expected, result.toArray()); } @Test - public void putUuidValid() throws Exception { - client.arrays().putUuidValid(Arrays.asList(UUID.fromString("6dcc7237-45fe-45c4-8a6b-3a8a3f625652"), - UUID.fromString("d1399005-30f7-40d6-8da6-dd7c89ad34db"), UUID.fromString("f42f6aa1-a5bc-4ddf-907e-5f915de43205"))); + public void putUuidValid() { + client.arrays().putUuidValid(Arrays.asList( + UUID.fromString("6dcc7237-45fe-45c4-8a6b-3a8a3f625652"), + UUID.fromString("d1399005-30f7-40d6-8da6-dd7c89ad34db"), + UUID.fromString("f42f6aa1-a5bc-4ddf-907e-5f915de43205"))); } @Test - public void getUuidInvalidChars() throws Exception { + public void getUuidInvalidChars() { try { - List result = client.arrays().getUuidInvalidChars(); + client.arrays().getUuidInvalidChars(); fail(); } catch (RuntimeException ex) { // expected - Assert.assertTrue(ex.getMessage(), ex.getMessage().contains("UUID has to be represented")); + assertTrue(ex.getMessage(), ex.getMessage().contains("UUID has to be represented")); } } @Test - public void getDateValid() throws Exception { + public void getDateValid() { List result = client.arrays().getDateValid(); Object[] expected = new LocalDate[] { - new LocalDate(2000, 12, 1), - new LocalDate(1980, 1, 2), - new LocalDate(1492, 10, 12) + LocalDate.of(2000, 12, 1), + LocalDate.of(1980, 1, 2), + LocalDate.of(1492, 10, 12) }; - Assert.assertArrayEquals(expected, result.toArray()); + assertArrayEquals(expected, result.toArray()); } @Test - public void putDateValid() throws Exception { + public void putDateValid() { client.arrays().putDateValid(Arrays.asList( - new LocalDate(2000, 12, 1), - new LocalDate(1980, 1, 2), - new LocalDate(1492, 10, 12) + LocalDate.of(2000, 12, 1), + LocalDate.of(1980, 1, 2), + LocalDate.of(1492, 10, 12) )); } @Test - public void getDateInvalidNull() throws Exception { - try { - List result = client.arrays().getDateInvalidNull(); - } catch (ErrorException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); - } + public void getDateInvalidNull() { + final List result = client.arrays().getDateInvalidNull(); + final LocalDate[] expected = new LocalDate[] { + LocalDate.of(2012, 1, 1), + null, + LocalDate.of(1776, 7, 4) + }; + assertArrayEquals(expected, result.toArray()); } @Test - public void getDateInvalidString() throws Exception { + public void getDateInvalidString() { try { - List result = client.arrays().getDateInvalidChars(); + client.arrays().getDateInvalidChars(); + fail(); } catch (RuntimeException ex) { // expected - Assert.assertTrue(ex.getMessage().contains("Invalid format: \"date\"")); + assertTrue(ex.getMessage().contains("Can not deserialize value")); } } @Test - public void getDateTimeValid() throws Exception { - List result = client.arrays().getDateTimeValid(); - Object[] expected = new DateTime[] { - new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC), - new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC), - new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC) + public void getDateTimeValid() { + List result = client.arrays().getDateTimeValid(); + OffsetDateTime[] expected = new OffsetDateTime[] { + OffsetDateTime.of(2000, 12, 1, 0, 0, 1, 0, ZoneOffset.UTC), + OffsetDateTime.of(1980, 1, 2, 0, 11, 35, 0, ZoneOffset.UTC), + OffsetDateTime.of(1492, 10, 12, 10, 15, 1, 0, ZoneOffset.UTC) }; - Assert.assertArrayEquals(expected, result.toArray()); + assertArrayEquals(expected, result.toArray()); } @Test - public void putDateTimeValid() throws Exception { + public void putDateTimeValid() { client.arrays().putDateTimeValid(Arrays.asList( - new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC), - new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC), - new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC) + OffsetDateTime.of(2000, 12, 1, 0, 0, 1, 0, ZoneOffset.UTC), + OffsetDateTime.of(1980, 1, 2, 0, 11, 35, 0, ZoneOffset.UTC), + OffsetDateTime.of(1492, 10, 12, 10, 15, 1, 0, ZoneOffset.UTC) )); } @Test - public void getDateTimeInvalidNull() throws Exception { - try { - List result = client.arrays().getDateTimeInvalidNull(); - } catch (ErrorException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); - } + public void getDateTimeInvalidNull() { + final List result = client.arrays().getDateTimeInvalidNull(); + final OffsetDateTime[] expected = new OffsetDateTime[] { + OffsetDateTime.of(2000, 12, 1, 0, 0, 1, 0, ZoneOffset.UTC), + null + }; + assertArrayEquals(expected, result.toArray()); } @Test - public void getDateTimeInvalidString() throws Exception { + public void getDateTimeInvalidString() { try { - List result = client.arrays().getDateTimeInvalidChars(); - } catch (RuntimeException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("Invalid format: \"date-time\"")); + client.arrays().getDateTimeInvalidChars(); + fail(); + } catch (RuntimeException e) { + assertTrue(e.getMessage().contains("Can not deserialize value")); } } @Test - public void getDateTimeRfc1123Valid() throws Exception { - List result = client.arrays().getDateTimeRfc1123Valid(); - Object[] expected = new DateTime[] { - new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC), - new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC), - new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC) + public void getDateTimeRfc1123Valid() { + List result = client.arrays().getDateTimeRfc1123Valid(); + OffsetDateTime[] expected = new OffsetDateTime[] { + OffsetDateTime.of(2000, 12, 1, 0, 0, 1, 0, ZoneOffset.UTC), + OffsetDateTime.of(1980, 1, 2, 0, 11, 35, 0, ZoneOffset.UTC), + OffsetDateTime.of(1492, 10, 12, 10, 15, 1, 0, ZoneOffset.UTC) }; - Assert.assertArrayEquals(expected, result.toArray()); + assertArrayEquals(expected, result.toArray()); } @Test - public void putDateTimeRfc1123Valid() throws Exception { + public void putDateTimeRfc1123Valid() { client.arrays().putDateTimeRfc1123Valid(Arrays.asList( - new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC), - new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC), - new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC) + OffsetDateTime.of(2000, 12, 1, 0, 0, 1, 0, ZoneOffset.UTC), + OffsetDateTime.of(1980, 1, 2, 0, 11, 35, 0, ZoneOffset.UTC), + OffsetDateTime.of(1492, 10, 12, 10, 15, 1, 0, ZoneOffset.UTC) )); } @Test - public void getDurationValid() throws Exception { - List result = client.arrays().getDurationValid(); - Object[] expected = new Period[] { - new Period(0, 0, 0, 123, 22, 14, 12, 11), - new Period(0, 0, 0, 5, 1, 0, 0, 0) + public void getDurationValid() { + List result = client.arrays().getDurationValid(); + Duration[] expected = new Duration[] { + Duration.ofDays(123).plusHours(22).plusMinutes(14).plusSeconds(12).plusMillis(11), + Duration.ofDays(5).plusHours(1) }; - Assert.assertArrayEquals(expected, result.toArray()); + assertArrayEquals(expected, result.toArray()); } @Test - public void putDurationValid() throws Exception { + public void putDurationValid() { client.arrays().putDurationValid(Arrays.asList( - new Period(0, 0, 0, 123, 22, 14, 12, 11), - new Period(0, 0, 0, 5, 1, 0, 0, 0))); + Duration.ofDays(123).plusHours(22).plusMinutes(14).plusSeconds(12).plusMillis(11), + Duration.ofDays(5).plusHours(1))); } @Test - public void getByteValid() throws Exception { + public void getByteValid() { List result = client.arrays().getByteValid(); Object[] expected = new byte[][] { new byte[] {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFA}, new byte[] {(byte) 0x01, (byte) 0x02, (byte) 0x03}, new byte[] {(byte) 0x25, (byte) 0x29, (byte) 0x43} }; - Assert.assertArrayEquals(expected, result.toArray()); + assertArrayEquals(expected, result.toArray()); } @Test - public void putByteValid() throws Exception { + public void putByteValid() { client.arrays().putByteValid(Arrays.asList( new byte[] {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFA}, new byte[] {(byte) 0x01, (byte) 0x02, (byte) 0x03}, @@ -411,65 +398,61 @@ public void putByteValid() throws Exception { } @Test - public void getByteInvalidNull() throws Exception { - try { - List result = client.arrays().getByteInvalidNull(); - } catch (ErrorException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); - } + public void getByteInvalidNull() { + final List result = client.arrays().getByteInvalidNull(); + final byte[][] expected = new byte[][] { + new byte[] { -85, -84, -83 }, + null + }; + assertArrayEquals(expected, result.toArray()); } @Test - public void getBase64Url() throws Exception { + public void getBase64Url() { List result = client.arrays().getBase64Url(); - Assert.assertEquals(3, result.size()); - Assert.assertEquals("a string that gets encoded with base64url", new String(result.get(0))); - Assert.assertEquals("test string", new String(result.get(1))); - Assert.assertEquals("Lorem ipsum", new String(result.get(2))); + assertEquals(3, result.size()); + assertEquals("a string that gets encoded with base64url", new String(result.get(0))); + assertEquals("test string", new String(result.get(1))); + assertEquals("Lorem ipsum", new String(result.get(2))); } @Test - public void getComplexNull() throws Exception { - try { - List result = client.arrays().getComplexNull(); - } catch (ErrorException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); - } + public void getComplexNull() { + final List result = client.arrays().getComplexNull(); + assertNull(result); } @Test - public void getComplexEmpty() throws Exception { + public void getComplexEmpty() { List result = client.arrays().getComplexEmpty(); - Assert.assertEquals(0, result.size()); + assertEquals(0, result.size()); } @Test - public void getComplexItemNull() throws Exception { + public void getComplexItemNull() { List result = client.arrays().getComplexItemNull(); - Assert.assertEquals(3, result.size()); - Assert.assertNull(result.get(1)); + assertEquals(3, result.size()); + assertNull(result.get(1)); } @Test - public void getComplexItemEmpty() throws Exception { + public void getComplexItemEmpty() { List result = client.arrays().getComplexItemEmpty(); - Assert.assertEquals(3, result.size()); - Assert.assertNull(result.get(1).stringProperty()); + assertEquals(3, result.size()); + assertNull(result.get(1).stringProperty()); } @Test - public void getComplexValid() throws Exception { + public void getComplexValid() { List result = client.arrays().getComplexValid(); - Assert.assertEquals(3, result.size()); - Assert.assertEquals(5, result.get(2).integer().intValue()); - Assert.assertEquals("6", result.get(2).stringProperty()); + assertEquals(3, result.size()); + assertEquals(5, result.get(2).integer().intValue()); + assertEquals("6", result.get(2).stringProperty()); } @Test - public void putComplexValid() throws Exception { - List body = new ArrayList(); + public void putComplexValid() { + List body = new ArrayList<>(); Product p1 = new Product(); p1.withInteger(1); p1.withStringProperty("2"); @@ -486,46 +469,42 @@ public void putComplexValid() throws Exception { } @Test - public void getArrayNull() throws Exception { - try { - List> result = client.arrays().getArrayNull(); - } catch (ErrorException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); - } + public void getArrayNull() { + List> result = client.arrays().getArrayNull(); + assertNull(result); } @Test - public void getArrayEmpty() throws Exception { + public void getArrayEmpty() { List> result = client.arrays().getArrayEmpty(); - Assert.assertEquals(0, result.size()); + assertEquals(0, result.size()); } @Test - public void getArrayItemNull() throws Exception { + public void getArrayItemNull() { List> result = client.arrays().getArrayItemNull(); - Assert.assertEquals(3, result.size()); - Assert.assertNull(result.get(1)); + assertEquals(3, result.size()); + assertNull(result.get(1)); } @Test - public void getArrayItemEmpty() throws Exception { + public void getArrayItemEmpty() { List> result = client.arrays().getArrayItemEmpty(); - Assert.assertEquals(3, result.size()); - Assert.assertEquals(0, result.get(1).size()); + assertEquals(3, result.size()); + assertEquals(0, result.get(1).size()); } @Test - public void getArrayValid() throws Exception { + public void getArrayValid() { List> result = client.arrays().getArrayValid(); - Assert.assertArrayEquals(new String[]{"1", "2", "3"}, result.get(0).toArray()); - Assert.assertArrayEquals(new String[]{"4", "5", "6"}, result.get(1).toArray()); - Assert.assertArrayEquals(new String[] {"7", "8", "9"}, result.get(2).toArray()); + assertArrayEquals(new String[]{"1", "2", "3"}, result.get(0).toArray()); + assertArrayEquals(new String[]{"4", "5", "6"}, result.get(1).toArray()); + assertArrayEquals(new String[] {"7", "8", "9"}, result.get(2).toArray()); } @Test - public void putArrayValid() throws Exception { - List> body = new ArrayList>(); + public void putArrayValid() { + List> body = new ArrayList<>(); body.add(Arrays.asList("1", "2", "3")); body.add(Arrays.asList("4", "5", "6")); body.add(Arrays.asList("7", "8", "9")); @@ -533,57 +512,53 @@ public void putArrayValid() throws Exception { } @Test - public void getDictionaryNull() throws Exception { - try { - List> result = client.arrays().getDictionaryNull(); - } catch (ErrorException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); - } + public void getDictionaryNull() { + final List> result = client.arrays().getDictionaryNull(); + assertNull(result); } @Test - public void getDictionaryEmpty() throws Exception { + public void getDictionaryEmpty() { List> result = client.arrays().getDictionaryEmpty(); - Assert.assertEquals(0, result.size()); + assertEquals(0, result.size()); } @Test - public void getDictionaryItemNull() throws Exception { + public void getDictionaryItemNull() { List> result = client.arrays().getDictionaryItemNull(); - Assert.assertEquals(3, result.size()); - Assert.assertNull(result.get(1)); + assertEquals(3, result.size()); + assertNull(result.get(1)); } @Test - public void getDictionaryItemEmpty() throws Exception { + public void getDictionaryItemEmpty() { List> result = client.arrays().getDictionaryItemEmpty(); - Assert.assertEquals(3, result.size()); - Assert.assertEquals(0, result.get(1).size()); + assertEquals(3, result.size()); + assertEquals(0, result.get(1).size()); } @Test - public void getDictionaryValid() throws Exception { + public void getDictionaryValid() { List> result = client.arrays().getDictionaryValid(); - Assert.assertEquals("seven", result.get(2).get("7")); - Assert.assertEquals("five", result.get(1).get("5")); - Assert.assertEquals("three", result.get(0).get("3")); + assertEquals("seven", result.get(2).get("7")); + assertEquals("five", result.get(1).get("5")); + assertEquals("three", result.get(0).get("3")); } @Test - public void putDictionaryValid() throws Exception { - List> body = new ArrayList>(); - Map m1 = new HashMap(); + public void putDictionaryValid() { + List> body = new ArrayList<>(); + Map m1 = new HashMap<>(); m1.put("1", "one"); m1.put("2", "two"); m1.put("3", "three"); body.add(m1); - Map m2 = new HashMap(); + Map m2 = new HashMap<>(); m2.put("4", "four"); m2.put("5", "five"); m2.put("6", "six"); body.add(m2); - Map m3 = new HashMap(); + Map m3 = new HashMap<>(); m3.put("7", "seven"); m3.put("8", "eight"); m3.put("9", "nine"); diff --git a/test/vanilla/src/test/java/fixtures/bodycomplex/PolymorphismTests.java b/test/vanilla/src/test/java/fixtures/bodycomplex/PolymorphismTests.java index 67664fd2ed..264f447c0d 100644 --- a/test/vanilla/src/test/java/fixtures/bodycomplex/PolymorphismTests.java +++ b/test/vanilla/src/test/java/fixtures/bodycomplex/PolymorphismTests.java @@ -6,12 +6,12 @@ import fixtures.bodycomplex.models.Salmon; import fixtures.bodycomplex.models.Sawshark; import fixtures.bodycomplex.models.Shark; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; import java.util.ArrayList; public class PolymorphismTests { @@ -23,7 +23,7 @@ public static void setup() { } @Test - public void getValid() throws Exception { + public void getValid() { Fish result = client.polymorphisms().getValid(); Assert.assertEquals(Salmon.class, result.getClass()); Salmon salmon = (Salmon) result; @@ -32,7 +32,7 @@ public void getValid() throws Exception { Assert.assertEquals(3, salmon.siblings().size()); Assert.assertEquals(Shark.class, salmon.siblings().get(0).getClass()); Shark sib1 = (Shark) (salmon.siblings().get(0)); - Assert.assertEquals(new DateTime(2012, 1, 5, 1, 0, 0, DateTimeZone.UTC), sib1.birthday()); + Assert.assertEquals(OffsetDateTime.of(2012, 1, 5, 1, 0, 0, 0, ZoneOffset.UTC), sib1.birthday()); Assert.assertEquals(Sawshark.class, salmon.siblings().get(1).getClass()); Sawshark sib2 = (Sawshark) (salmon.siblings().get(1)); Assert.assertArrayEquals( @@ -44,24 +44,24 @@ public void getValid() throws Exception { } @Test - public void putValid() throws Exception { + public void putValid() { Salmon body = new Salmon(); body.withLocation("alaska"); body.withIswild(true); body.withSpecies("king"); body.withLength(1.0); - body.withSiblings(new ArrayList()); + body.withSiblings(new ArrayList<>()); Shark sib1 = new Shark(); sib1.withAge(6); - sib1.withBirthday(new DateTime(2012, 1, 5, 1, 0, 0, DateTimeZone.UTC)); + sib1.withBirthday(OffsetDateTime.of(2012, 1, 5, 1, 0, 0, 0, ZoneOffset.UTC)); sib1.withLength(20.0); sib1.withSpecies("predator"); body.siblings().add(sib1); Sawshark sib2 = new Sawshark(); sib2.withAge(105); - sib2.withBirthday(new DateTime(1900, 1, 5, 1, 0, 0, DateTimeZone.UTC)); + sib2.withBirthday(OffsetDateTime.of(1900, 1, 5, 1, 0, 0, 0, ZoneOffset.UTC)); sib2.withLength(10.0); sib2.withPicture(new byte[] {(byte) 255, (byte) 255, (byte) 255, (byte) 255, (byte) 254}); sib2.withSpecies("dangerous"); @@ -69,7 +69,7 @@ public void putValid() throws Exception { Goblinshark sib3 = new Goblinshark(); sib3.withAge(1); - sib3.withBirthday(new DateTime(2015, 8, 8, 0, 0, 0, DateTimeZone.UTC)); + sib3.withBirthday(OffsetDateTime.of(2015, 8, 8, 0, 0, 0, 0, ZoneOffset.UTC)); sib3.withLength(30.0); sib3.withSpecies("scary"); sib3.withJawsize(5); @@ -79,18 +79,18 @@ public void putValid() throws Exception { } @Test - public void putValidMissingRequired() throws Exception { + public void putValidMissingRequired() { try { Salmon body = new Salmon(); body.withLocation("alaska"); body.withIswild(true); body.withSpecies("king"); body.withLength(1.0); - body.withSiblings(new ArrayList()); + body.withSiblings(new ArrayList<>()); Shark sib1 = new Shark(); sib1.withAge(6); - sib1.withBirthday(new DateTime(2012, 1, 5, 1, 0, 0, DateTimeZone.UTC)); + sib1.withBirthday(OffsetDateTime.of(2012, 1, 5, 1, 0, 0, 0, ZoneOffset.UTC)); sib1.withLength(20.0); sib1.withSpecies("predator"); body.siblings().add(sib1); diff --git a/test/vanilla/src/test/java/fixtures/bodycomplex/PolymorphismrecursiveTests.java b/test/vanilla/src/test/java/fixtures/bodycomplex/PolymorphismrecursiveTests.java index 725b89bf39..7ec99fdf27 100644 --- a/test/vanilla/src/test/java/fixtures/bodycomplex/PolymorphismrecursiveTests.java +++ b/test/vanilla/src/test/java/fixtures/bodycomplex/PolymorphismrecursiveTests.java @@ -5,12 +5,12 @@ import fixtures.bodycomplex.models.Salmon; import fixtures.bodycomplex.models.Sawshark; import fixtures.bodycomplex.models.Shark; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; import java.util.ArrayList; public class PolymorphismrecursiveTests { @@ -29,7 +29,7 @@ public void getValid() throws Exception { Salmon sib2 = (Salmon) (sib1.siblings().get(0)); Shark sib3 = (Shark) (sib2.siblings().get(0)); Assert.assertEquals( - new DateTime(2012, 1, 5, 1, 0, 0, DateTimeZone.UTC), + OffsetDateTime.of(2012, 1, 5, 1, 0, 0, 0, ZoneOffset.UTC), sib3.birthday()); } @@ -44,7 +44,7 @@ public void putValid() throws Exception { Shark sib1 = new Shark(); sib1.withAge(6); - sib1.withBirthday(new DateTime(2012, 1, 5, 1, 0, 0, DateTimeZone.UTC)); + sib1.withBirthday(OffsetDateTime.of(2012, 1, 5, 1, 0, 0, 0, ZoneOffset.UTC)); sib1.withLength(20.0); sib1.withSpecies("predator"); sib1.withSiblings(new ArrayList()); @@ -52,7 +52,7 @@ public void putValid() throws Exception { Sawshark sib2 = new Sawshark(); sib2.withAge(105); - sib2.withBirthday(new DateTime(1900, 1, 5, 1, 0, 0, DateTimeZone.UTC)); + sib2.withBirthday(OffsetDateTime.of(1900, 1, 5, 1, 0, 0, 0, ZoneOffset.UTC)); sib2.withLength(10.0); sib2.withPicture(new byte[] {(byte) 255, (byte) 255, (byte) 255, (byte) 255, (byte) 254}); sib2.withSpecies("dangerous"); @@ -70,14 +70,14 @@ public void putValid() throws Exception { Shark sib111 = new Shark(); sib111.withAge(6); - sib111.withBirthday(new DateTime(2012, 1, 5, 1, 0, 0, DateTimeZone.UTC)); + sib111.withBirthday(OffsetDateTime.of(2012, 1, 5, 1, 0, 0, 0, ZoneOffset.UTC)); sib111.withSpecies("predator"); sib111.withLength(20); sib11.siblings().add(sib111); Sawshark sib112 = new Sawshark(); sib112.withAge(105); - sib112.withBirthday(new DateTime(1900, 1, 5, 1, 0, 0, DateTimeZone.UTC)); + sib112.withBirthday(OffsetDateTime.of(1900, 1, 5, 1, 0, 0, 0, ZoneOffset.UTC)); sib112.withLength(10.0); sib112.withPicture(new byte[] {(byte) 255, (byte) 255, (byte) 255, (byte) 255, (byte) 254}); sib112.withSpecies("dangerous"); diff --git a/test/vanilla/src/test/java/fixtures/bodycomplex/PrimitiveTests.java b/test/vanilla/src/test/java/fixtures/bodycomplex/PrimitiveTests.java index 4abcd8d000..970b7ecade 100644 --- a/test/vanilla/src/test/java/fixtures/bodycomplex/PrimitiveTests.java +++ b/test/vanilla/src/test/java/fixtures/bodycomplex/PrimitiveTests.java @@ -12,14 +12,15 @@ import fixtures.bodycomplex.models.IntWrapper; import fixtures.bodycomplex.models.LongWrapper; import fixtures.bodycomplex.models.StringWrapper; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.joda.time.LocalDate; -import org.joda.time.Period; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import java.time.Duration; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + public class PrimitiveTests { private static AutoRestComplexTestService client; @@ -124,58 +125,58 @@ public void putString() throws Exception { @Test public void getDate() throws Exception { DateWrapper result = client.primitives().getDate(); - Assert.assertEquals(new LocalDate(1, 1, 1), result.field()); - Assert.assertEquals(new LocalDate(2016, 2, 29), result.leap()); + Assert.assertEquals(LocalDate.of(1, 1, 1), result.field()); + Assert.assertEquals(LocalDate.of(2016, 2, 29), result.leap()); } @Test public void putDate() throws Exception { DateWrapper body = new DateWrapper(); - body.withField(new LocalDate(1, 1, 1)); - body.withLeap(new LocalDate(2016, 2, 29)); + body.withField(LocalDate.of(1, 1, 1)); + body.withLeap(LocalDate.of(2016, 2, 29)); client.primitives().putDate(body); } @Test public void getDateTime() throws Exception { DatetimeWrapper result = client.primitives().getDateTime(); - Assert.assertEquals(new DateTime(1, 1, 1, 0, 0, 0, DateTimeZone.UTC), result.field()); - Assert.assertEquals(new DateTime(2015, 5, 18, 18, 38, 0, DateTimeZone.UTC), result.now()); + Assert.assertEquals(OffsetDateTime.of(1, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC), result.field()); + Assert.assertEquals(OffsetDateTime.of(2015, 5, 18, 18, 38, 0, 0, ZoneOffset.UTC), result.now()); } @Test public void putDateTime() throws Exception { DatetimeWrapper body = new DatetimeWrapper(); - body.withField(new DateTime(1, 1, 1, 0, 0, 0, DateTimeZone.UTC)); - body.withNow(new DateTime(2015, 5, 18, 18, 38, 0, DateTimeZone.UTC)); + body.withField(OffsetDateTime.of(1, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)); + body.withNow(OffsetDateTime.of(2015, 5, 18, 18, 38, 0, 0, ZoneOffset.UTC)); client.primitives().putDateTime(body); } @Test public void getDateTimeRfc1123() throws Exception { Datetimerfc1123Wrapper result = client.primitives().getDateTimeRfc1123(); - Assert.assertEquals(new DateTime(1, 1, 1, 0, 0, 0, DateTimeZone.UTC), result.field()); - Assert.assertEquals(new DateTime(2015, 5, 18, 11, 38, 0, DateTimeZone.UTC), result.now()); + Assert.assertEquals(OffsetDateTime.of(1, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC), result.field()); + Assert.assertEquals(OffsetDateTime.of(2015, 5, 18, 11, 38, 0, 0, ZoneOffset.UTC), result.now()); } @Test public void putDateTimeRfc1123() throws Exception { Datetimerfc1123Wrapper body = new Datetimerfc1123Wrapper(); - body.withField(new DateTime(1, 1, 1, 0, 0, 0, DateTimeZone.UTC)); - body.withNow(new DateTime(2015, 5, 18, 11, 38, 0, DateTimeZone.UTC)); + body.withField(OffsetDateTime.of(1, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)); + body.withNow(OffsetDateTime.of(2015, 5, 18, 11, 38, 0, 0, ZoneOffset.UTC)); client.primitives().putDateTimeRfc1123(body); } @Test public void getDuration() throws Exception { DurationWrapper result = client.primitives().getDuration(); - Assert.assertEquals(new Period(0, 0, 0, 123, 22, 14, 12, 11), result.field()); + Assert.assertEquals(Duration.ofDays(123).plusHours(22).plusMinutes(14).plusSeconds(12).plusMillis(11), result.field()); } @Test public void putDuration() throws Exception { DurationWrapper body = new DurationWrapper(); - body.withField(new Period(0, 0, 0, 123, 22, 14, 12, 11)); + body.withField(Duration.ofDays(123).plusHours(22).plusMinutes(14).plusSeconds(12).plusMillis(11)); client.primitives().putDuration(body); } diff --git a/test/vanilla/src/test/java/fixtures/bodydate/DateOperationsTests.java b/test/vanilla/src/test/java/fixtures/bodydate/DateOperationsTests.java index ca0d7d6654..c3aec0482d 100644 --- a/test/vanilla/src/test/java/fixtures/bodydate/DateOperationsTests.java +++ b/test/vanilla/src/test/java/fixtures/bodydate/DateOperationsTests.java @@ -1,17 +1,16 @@ package fixtures.bodydate; +import com.fasterxml.jackson.databind.exc.InvalidFormatException; import fixtures.bodydate.implementation.AutoRestDateTestServiceImpl; -import org.joda.time.IllegalFieldValueException; -import org.joda.time.LocalDate; -import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; -import java.util.concurrent.CountDownLatch; +import java.time.LocalDate; + +import static org.junit.Assert.*; public class DateOperationsTests { private static AutoRestDateTestService client; - private CountDownLatch lock = new CountDownLatch(1); @BeforeClass public static void setup() { @@ -19,66 +18,63 @@ public static void setup() { } @Test - public void getNull() throws Exception { - Assert.assertNull(client.dates().getNull()); + public void getNull() { + assertNull(client.dates().getNull()); } @Test - public void getInvalidDate() throws Exception { + public void getInvalidDate() { try { client.dates().getInvalidDate(); - Assert.assertTrue(false); - } catch (Exception exception) { - // expected - Assert.assertEquals(IllegalArgumentException.class, exception.getClass()); + fail(); + } catch (RuntimeException exception) { + assertEquals(InvalidFormatException.class, exception.getCause().getClass()); } } @Test - public void getOverflowDate() throws Exception { + public void getOverflowDate() { try { client.dates().getOverflowDate(); - Assert.assertTrue(false); - } catch (Exception exception) { - // expected - Assert.assertEquals(IllegalArgumentException.class, exception.getClass()); + fail(); + } catch (RuntimeException exception) { + assertEquals(InvalidFormatException.class, exception.getCause().getClass()); } } @Test - public void getUnderflowDate() throws Exception { + public void getUnderflowDate() { try { client.dates().getUnderflowDate(); - Assert.assertTrue(false); - } catch (Exception exception) { - // expected - Assert.assertEquals(IllegalFieldValueException.class, exception.getClass()); + fail(); + } catch (RuntimeException exception) { + assertEquals(InvalidFormatException.class, exception.getCause().getClass()); } } @Test - public void putMaxDate() throws Exception { - LocalDate body = new LocalDate(9999, 12, 31); + public void putMaxDate() { + LocalDate body = LocalDate.of(9999, 12, 31); client.dates().putMaxDate(body); } @Test - public void getMaxDate() throws Exception { - LocalDate expected = new LocalDate(9999, 12, 31); + public void getMaxDate() { + LocalDate expected = LocalDate.of(9999, 12, 31); LocalDate result = client.dates().getMaxDate(); - Assert.assertEquals(expected, result); + assertEquals(expected, result); } @Test - public void putMinDate() throws Exception { - LocalDate body = new LocalDate(1, 1, 1); + public void putMinDate() { + LocalDate body = LocalDate.of(1, 1, 1); client.dates().putMinDate(body); } @Test - public void getMinDate() throws Exception { - LocalDate expected = new LocalDate(1, 1, 1); + public void getMinDate() { + LocalDate expected = LocalDate.of(1, 1, 1); LocalDate result = client.dates().getMinDate(); - Assert.assertEquals(expected, result); + assertEquals(expected, result); } } diff --git a/test/vanilla/src/test/java/fixtures/bodydatetime/DatetimeOperationsTests.java b/test/vanilla/src/test/java/fixtures/bodydatetime/DatetimeOperationsTests.java index 6de216d782..e66bd921dd 100644 --- a/test/vanilla/src/test/java/fixtures/bodydatetime/DatetimeOperationsTests.java +++ b/test/vanilla/src/test/java/fixtures/bodydatetime/DatetimeOperationsTests.java @@ -1,13 +1,13 @@ package fixtures.bodydatetime; +import com.fasterxml.jackson.databind.exc.InvalidFormatException; import fixtures.bodydatetime.implementation.AutoRestDateTimeTestServiceImpl; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.joda.time.IllegalFieldValueException; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import java.time.*; + public class DatetimeOperationsTests { private static AutoRestDateTimeTestService client; @@ -17,137 +17,134 @@ public static void setup() { } @Test - public void getNull() throws Exception { + public void getNull() { Assert.assertNull(client.datetimes().getNull()); } @Test - public void getInvalidDate() throws Exception { + public void getInvalidDate() { try { client.datetimes().getInvalid(); - Assert.assertTrue(false); - } catch (Exception exception) { - // expected - Assert.assertEquals(IllegalArgumentException.class, exception.getClass()); + Assert.fail(); + } catch (RuntimeException exception) { + Assert.assertEquals(InvalidFormatException.class, exception.getCause().getClass()); } } @Test - public void getOverflowDate() throws Exception { - DateTime result = client.datetimes().getOverflow(); - // 9999-12-31T23:59:59.999-14:000 - DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(-14)); - expected = expected.toDateTime(DateTimeZone.UTC); + public void getOverflowDate() { + OffsetDateTime result = client.datetimes().getOverflow(); + OffsetDateTime expected = OffsetDateTime.of(LocalDate.of(10000, 1, 1), LocalTime.parse("13:59:59.9999999"), ZoneOffset.UTC); Assert.assertEquals(expected, result); } @Test - public void getUnderflowDate() throws Exception { + public void getUnderflowDate() { try { client.datetimes().getUnderflow(); - Assert.assertTrue(false); - } catch (Exception exception) { + Assert.fail(); + } catch (RuntimeException exception) { // expected - Assert.assertEquals(IllegalFieldValueException.class, exception.getClass()); + Assert.assertEquals(InvalidFormatException.class, exception.getCause().getClass()); } } @Test - public void putUtcMaxDateTime() throws Exception { - DateTime body = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.UTC); + public void putUtcMaxDateTime() { + OffsetDateTime body = OffsetDateTime.parse("9999-12-31T23:59:59.999-00:00"); client.datetimes().putUtcMaxDateTime(body); } @Test - public void getUtcLowercaseMaxDateTime() throws Exception { - DateTime result = client.datetimes().getUtcLowercaseMaxDateTime(); - DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.UTC); + public void getUtcLowercaseMaxDateTime() { + OffsetDateTime result = client.datetimes().getUtcLowercaseMaxDateTime(); + OffsetDateTime expected = OffsetDateTime.parse("9999-12-31T23:59:59.9999999-00:00"); Assert.assertEquals(expected, result); } @Test - public void getUtcUppercaseMaxDateTime() throws Exception { - DateTime result = client.datetimes().getUtcUppercaseMaxDateTime(); - DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.UTC); + public void getUtcUppercaseMaxDateTime() { + OffsetDateTime result = client.datetimes().getUtcUppercaseMaxDateTime(); + OffsetDateTime expected = OffsetDateTime.parse("9999-12-31T23:59:59.9999999+00:00"); Assert.assertEquals(expected, result); } @Test - public void putLocalPositiveOffsetMaxDateTime() throws Exception { - DateTime body = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(14)); + public void putLocalPositiveOffsetMaxDateTime() { + OffsetDateTime body = OffsetDateTime.parse("9999-12-31T09:59:59.9999999Z"); client.datetimes().putLocalPositiveOffsetMaxDateTime(body); } @Test - public void getLocalPositiveOffsetLowercaseMaxDateTime() throws Exception { - DateTime result = client.datetimes().getLocalPositiveOffsetLowercaseMaxDateTime(); - DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(14)).toDateTime(DateTimeZone.UTC); + public void getLocalPositiveOffsetLowercaseMaxDateTime() { + OffsetDateTime result = client.datetimes().getLocalPositiveOffsetLowercaseMaxDateTime(); + OffsetDateTime expected = OffsetDateTime.parse("9999-12-31T09:59:59.9999999+00:00"); Assert.assertEquals(expected, result); } @Test - public void getLocalPositiveOffsetUppercaseMaxDateTime() throws Exception { - DateTime result = client.datetimes().getLocalPositiveOffsetUppercaseMaxDateTime(); - DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(14)).toDateTime(DateTimeZone.UTC); + public void getLocalPositiveOffsetUppercaseMaxDateTime() { + OffsetDateTime result = client.datetimes().getLocalPositiveOffsetUppercaseMaxDateTime(); + OffsetDateTime expected = OffsetDateTime.parse("9999-12-31T23:59:59.9999999+00:00").withOffsetSameLocal(ZoneOffset.ofHours(14)).withOffsetSameInstant(ZoneOffset.UTC); Assert.assertEquals(expected, result); } @Test - public void putLocalNegativeOffsetMaxDateTime() throws Exception { - DateTime body = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(-14)); + public void putLocalNegativeOffsetMaxDateTime() { + OffsetDateTime body = OffsetDateTime.of(LocalDate.of(10000, 1, 1), LocalTime.parse("13:59:59.999"), ZoneOffset.UTC); client.datetimes().putLocalNegativeOffsetMaxDateTime(body); } @Test - public void getLocalNegativeOffsetLowercaseMaxDateTime() throws Exception { - DateTime result = client.datetimes().getLocalNegativeOffsetLowercaseMaxDateTime(); - DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(-14)).toDateTime(DateTimeZone.UTC); + public void getLocalNegativeOffsetLowercaseMaxDateTime() { + OffsetDateTime result = client.datetimes().getLocalNegativeOffsetLowercaseMaxDateTime(); + OffsetDateTime expected = OffsetDateTime.parse("9999-12-31T23:59:59.9999999-00:00").withOffsetSameLocal(ZoneOffset.ofHours(-14)).withOffsetSameInstant(ZoneOffset.UTC); Assert.assertEquals(expected, result); } @Test - public void getLocalNegativeOffsetUppercaseMaxDateTime() throws Exception { - DateTime result = client.datetimes().getLocalNegativeOffsetUppercaseMaxDateTime(); - DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(-14)).toDateTime(DateTimeZone.UTC); + public void getLocalNegativeOffsetUppercaseMaxDateTime() { + OffsetDateTime result = client.datetimes().getLocalNegativeOffsetUppercaseMaxDateTime(); + OffsetDateTime expected = OffsetDateTime.of(LocalDate.of(10000, 1, 1), LocalTime.parse("13:59:59.9999999"), ZoneOffset.UTC); Assert.assertEquals(expected, result); } @Test - public void putUtcMinDateTime() throws Exception { - DateTime body = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC); + public void putUtcMinDateTime() { + OffsetDateTime body = OffsetDateTime.of(1, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); client.datetimes().putUtcMinDateTime(body); } @Test - public void getUtcMinDateTime() throws Exception { - DateTime result = client.datetimes().getUtcMinDateTime(); - DateTime expected = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC); + public void getUtcMinDateTime() { + OffsetDateTime result = client.datetimes().getUtcMinDateTime(); + OffsetDateTime expected = OffsetDateTime.of(1, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); Assert.assertEquals(expected, result); } @Test - public void putLocalPositiveOffsetMinDateTime() throws Exception { - DateTime body = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.forOffsetHours(14)); + public void putLocalPositiveOffsetMinDateTime() { + OffsetDateTime body = OffsetDateTime.of(1, 1, 1, 0, 0, 0, 0, ZoneOffset.ofHours(14)); client.datetimes().putLocalPositiveOffsetMinDateTime(body); } @Test - public void getLocalPositiveOffsetMinDateTime() throws Exception { - DateTime result = client.datetimes().getLocalPositiveOffsetMinDateTime(); - DateTime expected = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.forOffsetHours(14)).toDateTime(DateTimeZone.UTC); + public void getLocalPositiveOffsetMinDateTime() { + OffsetDateTime result = client.datetimes().getLocalPositiveOffsetMinDateTime(); + OffsetDateTime expected = OffsetDateTime.of(1, 1, 1, 0, 0, 0, 0, ZoneOffset.ofHours(14)).withOffsetSameInstant(ZoneOffset.UTC); Assert.assertEquals(expected, result); } @Test - public void putLocalNegativeOffsetMinDateTime() throws Exception { - DateTime body = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.forOffsetHours(-14)); + public void putLocalNegativeOffsetMinDateTime() { + OffsetDateTime body = OffsetDateTime.of(1, 1, 1, 0, 0, 0, 0, ZoneOffset.ofHours(-14)); client.datetimes().putLocalNegativeOffsetMinDateTime(body); } @Test - public void getLocalNegativeOffsetMinDateTime() throws Exception { - DateTime result = client.datetimes().getLocalNegativeOffsetMinDateTime(); - DateTime expected = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.forOffsetHours(-14)).toDateTime(DateTimeZone.UTC); + public void getLocalNegativeOffsetMinDateTime() { + OffsetDateTime result = client.datetimes().getLocalNegativeOffsetMinDateTime(); + OffsetDateTime expected = OffsetDateTime.of(1, 1, 1, 0, 0, 0, 0, ZoneOffset.ofHours(-14)).withOffsetSameInstant(ZoneOffset.UTC); Assert.assertEquals(expected, result); } } diff --git a/test/vanilla/src/test/java/fixtures/bodydatetimerfc1123/DateTimeRfc1123OperationsTests.java b/test/vanilla/src/test/java/fixtures/bodydatetimerfc1123/DateTimeRfc1123OperationsTests.java index 5dfa246dd7..4f22b9c83a 100644 --- a/test/vanilla/src/test/java/fixtures/bodydatetimerfc1123/DateTimeRfc1123OperationsTests.java +++ b/test/vanilla/src/test/java/fixtures/bodydatetimerfc1123/DateTimeRfc1123OperationsTests.java @@ -2,12 +2,13 @@ import com.fasterxml.jackson.databind.JsonMappingException; import fixtures.bodydatetimerfc1123.implementation.AutoRestRFC1123DateTimeTestServiceImpl; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + import static org.hamcrest.core.IsInstanceOf.instanceOf; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; @@ -21,12 +22,12 @@ public static void setup() { } @Test - public void getNull() throws Exception { + public void getNull() { Assert.assertNull(client.datetimerfc1123s().getNull()); } @Test - public void getInvalidDate() throws Exception { + public void getInvalidDate() { try { client.datetimerfc1123s().getInvalid(); fail(); @@ -36,15 +37,14 @@ public void getInvalidDate() throws Exception { } @Test - public void getOverflowDate() throws Exception { - DateTime result = client.datetimerfc1123s().getOverflow(); - DateTime expected = new DateTime(10000, 1, 1, 00, 00, 00, 0, DateTimeZone.UTC); - expected = expected.toDateTime(DateTimeZone.UTC); + public void getOverflowDate() { + OffsetDateTime result = client.datetimerfc1123s().getOverflow(); + OffsetDateTime expected = OffsetDateTime.of(10000, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); Assert.assertEquals(expected, result); } @Test - public void getUnderflowDate() throws Exception { + public void getUnderflowDate() { try { client.datetimerfc1123s().getUnderflow(); fail(); @@ -54,35 +54,35 @@ public void getUnderflowDate() throws Exception { } @Test - public void putUtcMaxDateTime() throws Exception { - DateTime body = new DateTime(9999, 12, 31, 23, 59, 59, 0, DateTimeZone.UTC); + public void putUtcMaxDateTime() { + OffsetDateTime body = OffsetDateTime.of(9999, 12, 31, 23, 59, 59, 0, ZoneOffset.UTC); client.datetimerfc1123s().putUtcMaxDateTime(body); } @Test - public void getUtcLowercaseMaxDateTime() throws Exception { - DateTime result = client.datetimerfc1123s().getUtcLowercaseMaxDateTime(); - DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 0, DateTimeZone.UTC); + public void getUtcLowercaseMaxDateTime() { + OffsetDateTime result = client.datetimerfc1123s().getUtcLowercaseMaxDateTime(); + OffsetDateTime expected = OffsetDateTime.of(9999, 12, 31, 23, 59, 59, 0, ZoneOffset.UTC); Assert.assertEquals(expected, result); } @Test - public void getUtcUppercaseMaxDateTime() throws Exception { - DateTime result = client.datetimerfc1123s().getUtcUppercaseMaxDateTime(); - DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 0, DateTimeZone.UTC); + public void getUtcUppercaseMaxDateTime() { + OffsetDateTime result = client.datetimerfc1123s().getUtcUppercaseMaxDateTime(); + OffsetDateTime expected = OffsetDateTime.of(9999, 12, 31, 23, 59, 59, 0, ZoneOffset.UTC); Assert.assertEquals(expected, result); } @Test - public void putUtcMinDateTime() throws Exception { - DateTime body = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC); + public void putUtcMinDateTime() { + OffsetDateTime body = OffsetDateTime.of(1, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); client.datetimerfc1123s().putUtcMinDateTime(body); } @Test - public void getUtcMinDateTime() throws Exception { - DateTime result = client.datetimerfc1123s().getUtcMinDateTime(); - DateTime expected = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC); + public void getUtcMinDateTime() { + OffsetDateTime result = client.datetimerfc1123s().getUtcMinDateTime(); + OffsetDateTime expected = OffsetDateTime.of(1, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); Assert.assertEquals(expected, result); } } diff --git a/test/vanilla/src/test/java/fixtures/bodydictionary/DictionaryTests.java b/test/vanilla/src/test/java/fixtures/bodydictionary/DictionaryTests.java index 9edcaeeb57..77f0603f10 100644 --- a/test/vanilla/src/test/java/fixtures/bodydictionary/DictionaryTests.java +++ b/test/vanilla/src/test/java/fixtures/bodydictionary/DictionaryTests.java @@ -1,22 +1,18 @@ package fixtures.bodydictionary; +import com.fasterxml.jackson.databind.exc.InvalidFormatException; import fixtures.bodydictionary.implementation.AutoRestSwaggerBATdictionaryServiceImpl; import fixtures.bodydictionary.models.Widget; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.joda.time.LocalDate; -import org.joda.time.Period; -import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import java.time.*; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; public class DictionaryTests { private static AutoRestSwaggerBATdictionaryService client; @@ -27,69 +23,67 @@ public static void setup() { } @Test - public void getNull() throws Exception { - Assert.assertNull(client.dictionarys().getNull()); + public void getNull() { + assertNull(client.dictionarys().getNull()); } @Test - public void getInvalid() throws Exception { + public void getInvalid() { try { client.dictionarys().getInvalid(); fail(); } catch (RuntimeException exception) { - // expected - Assert.assertTrue(exception.getMessage().contains("HTTP response has a malformed body")); + assertTrue(exception.getMessage().contains("HTTP response has a malformed body")); } } @Test - public void getEmpty() throws Exception { + public void getEmpty() { Map result = client.dictionarys().getEmpty(); - Assert.assertEquals(0, result.keySet().size()); + assertEquals(0, result.keySet().size()); } @Test - public void putEmpty() throws Exception { - client.dictionarys().putEmpty(new HashMap()); + public void putEmpty() { + client.dictionarys().putEmpty(new HashMap<>()); } @Test - public void getNullValue() throws Exception { + public void getNullValue() { Map result = client.dictionarys().getNullValue(); - Assert.assertNull(result.get("key1")); + assertNull(result.get("key1")); } @Test - public void getNullKey() throws Exception { + public void getNullKey() { try { client.dictionarys().getNullKey(); fail(); } catch (RuntimeException exception) { - // expected - Assert.assertTrue(exception.getMessage().contains("HTTP response has a malformed body")); + assertTrue(exception.getMessage().contains("HTTP response has a malformed body")); } } @Test - public void getEmptyStringKey() throws Exception { + public void getEmptyStringKey() { Map result = client.dictionarys().getEmptyStringKey(); - Assert.assertEquals("val1", result.get("")); + assertEquals("val1", result.get("")); } @Test - public void getBooleanTfft() throws Exception { + public void getBooleanTfft() { Map result = client.dictionarys().getBooleanTfft(); - Map expected = new HashMap(); + Map expected = new HashMap<>(); expected.put("0", true); expected.put("1", false); expected.put("2", false); expected.put("3", true); - Assert.assertEquals(expected, result); + assertEquals(expected, result); } @Test - public void putBooleanTfft() throws Exception { - Map testData = new HashMap(); + public void putBooleanTfft() { + Map testData = new HashMap<>(); testData.put("0", true); testData.put("1", false); testData.put("2", false); @@ -98,35 +92,35 @@ public void putBooleanTfft() throws Exception { } @Test - public void getBooleanInvalidNull() throws Exception { + public void getBooleanInvalidNull() { Map result = client.dictionarys().getBooleanInvalidNull(); - Assert.assertNull(result.get("1")); + assertNull(result.get("1")); } @Test - public void getBooleanInvalidString() throws Exception { + public void getBooleanInvalidString() { try { - Map result = client.dictionarys().getBooleanInvalidString(); + client.dictionarys().getBooleanInvalidString(); } catch (RuntimeException ex) { // expected - Assert.assertTrue(ex.getMessage().contains("only \"true\" or \"false\" recognized")); + assertTrue(ex.getMessage().contains("only \"true\" or \"false\" recognized")); } } @Test - public void getIntegerValid() throws Exception { + public void getIntegerValid() { Map result = client.dictionarys().getIntegerValid(); - Map expected = new HashMap(); + Map expected = new HashMap<>(); expected.put("0", 1); expected.put("1", -1); expected.put("2", 3); expected.put("3", 300); - Assert.assertEquals(expected, result); + assertEquals(expected, result); } @Test - public void putIntegerValid() throws Exception { - Map testdata = new HashMap(); + public void putIntegerValid() { + Map testdata = new HashMap<>(); testdata.put("0", 1); testdata.put("1", -1); testdata.put("2", 3); @@ -135,36 +129,36 @@ public void putIntegerValid() throws Exception { } @Test - public void getIntInvalidNull() throws Exception { + public void getIntInvalidNull() { Map result = client.dictionarys().getIntInvalidNull(); - Assert.assertNull(result.get("1")); + assertNull(result.get("1")); } @Test - public void getIntInvalidString() throws Exception { + public void getIntInvalidString() { try { - Map result = client.dictionarys().getIntInvalidString(); + client.dictionarys().getIntInvalidString(); fail(); } catch (RuntimeException ex) { // expected - Assert.assertTrue(ex.getMessage().contains("not a valid Integer value")); + assertTrue(ex.getMessage().contains("not a valid Integer value")); } } @Test - public void getLongValid() throws Exception { + public void getLongValid() { Map result = client.dictionarys().getLongValid(); - HashMap expected = new HashMap(); + HashMap expected = new HashMap<>(); expected.put("0", 1L); expected.put("1", -1L); expected.put("2", 3L); expected.put("3", 300L); - Assert.assertEquals(expected, result); + assertEquals(expected, result); } @Test - public void putLongValid() throws Exception { - HashMap expected = new HashMap(); + public void putLongValid() { + HashMap expected = new HashMap<>(); expected.put("0", 1L); expected.put("1", -1L); expected.put("2", 3L); @@ -173,35 +167,35 @@ public void putLongValid() throws Exception { } @Test - public void getLongInvalidNull() throws Exception { + public void getLongInvalidNull() { Map result = client.dictionarys().getLongInvalidNull(); - Assert.assertNull(result.get("1")); + assertNull(result.get("1")); } @Test - public void getLongInvalidString() throws Exception { + public void getLongInvalidString() { try { - Map result = client.dictionarys().getLongInvalidString(); + client.dictionarys().getLongInvalidString(); fail(); } catch (RuntimeException ex) { // expected - Assert.assertTrue(ex.getMessage().contains("not a valid Long value")); + assertTrue(ex.getMessage().contains("not a valid Long value")); } } @Test - public void getFloatValid() throws Exception { + public void getFloatValid() { Map result = client.dictionarys().getFloatValid(); - Map expected = new HashMap(); + Map expected = new HashMap<>(); expected.put("0", 0d); expected.put("1", -0.01d); expected.put("2", -1.2e20d); - Assert.assertEquals(expected, result); + assertEquals(expected, result); } @Test - public void putFloatValid() throws Exception { - Map testdata = new HashMap(); + public void putFloatValid() { + Map testdata = new HashMap<>(); testdata.put("0", 0d); testdata.put("1", -0.01d); testdata.put("2", -1.2e20d); @@ -209,36 +203,36 @@ public void putFloatValid() throws Exception { } @Test - public void getFloatInvalidNull() throws Exception { + public void getFloatInvalidNull() { Map result = client.dictionarys().getFloatInvalidNull(); - Assert.assertNull(result.get("1")); + assertNull(result.get("1")); } @Test - public void getFloatInvalidString() throws Exception { + public void getFloatInvalidString() { try { - Map result = client.dictionarys().getFloatInvalidString(); + client.dictionarys().getFloatInvalidString(); fail(); } catch (RuntimeException ex) { // expected - Assert.assertTrue(ex.getMessage().contains("not a valid Double value")); + assertTrue(ex.getMessage().contains("not a valid Double value")); } } @Test - public void getDoubleValid() throws Exception { + public void getDoubleValid() { Map result = client.dictionarys().getDoubleValid(); - Map expected = new HashMap(); + Map expected = new HashMap<>(); expected.put("0", 0d); expected.put("1", -0.01d); expected.put("2", -1.2e20d); - Assert.assertEquals(expected, result); + assertEquals(expected, result); } @Test - public void putDoubleValid() throws Exception { + public void putDoubleValid() { //{"0": 0, "1": -0.01, "2": 1.2e20} - Map testdata = new HashMap(); + Map testdata = new HashMap<>(); testdata.put("0", 0d); testdata.put("1", -0.01d); testdata.put("2", -1.2e20d); @@ -246,35 +240,35 @@ public void putDoubleValid() throws Exception { } @Test - public void getDoubleInvalidNull() throws Exception { + public void getDoubleInvalidNull() { Map result = client.dictionarys().getDoubleInvalidNull(); - Assert.assertNull(result.get("1")); + assertNull(result.get("1")); } @Test - public void getDoubleInvalidString() throws Exception { + public void getDoubleInvalidString() { try { - Map result = client.dictionarys().getDoubleInvalidString(); + client.dictionarys().getDoubleInvalidString(); fail(); } catch (RuntimeException ex) { // expected - Assert.assertTrue(ex.getMessage().contains("not a valid Double value")); + assertTrue(ex.getMessage().contains("not a valid Double value")); } } @Test - public void getStringValid() throws Exception { + public void getStringValid() { Map result = client.dictionarys().getStringValid(); - Map expected = new HashMap(); + Map expected = new HashMap<>(); expected.put("0", "foo1"); expected.put("1", "foo2"); expected.put("2", "foo3"); - Assert.assertEquals(expected, result); + assertEquals(expected, result); } @Test - public void putStringValid() throws Exception { - Map testdata = new HashMap(); + public void putStringValid() { + Map testdata = new HashMap<>(); testdata.put("0", "foo1"); testdata.put("1", "foo2"); testdata.put("2", "foo3"); @@ -282,142 +276,138 @@ public void putStringValid() throws Exception { } @Test - public void getStringWithNull() throws Exception { + public void getStringWithNull() { Map result = client.dictionarys().getStringWithNull(); - Assert.assertNull(result.get("1")); + assertNull(result.get("1")); } @Test - public void getStringWithInvalid() throws Exception { + public void getStringWithInvalid() { Map result = client.dictionarys().getStringWithInvalid(); - Assert.assertEquals("123", result.get("1")); + assertEquals("123", result.get("1")); } @Test - public void getDateValid() throws Exception { + public void getDateValid() { Map result = client.dictionarys().getDateValid(); - Map expected = new HashMap(); - expected.put("0", new LocalDate(2000, 12, 1)); - expected.put("1", new LocalDate(1980, 1, 2)); - expected.put("2", new LocalDate(1492, 10, 12)); - Assert.assertEquals(expected, result); + Map expected = new HashMap<>(); + expected.put("0", LocalDate.of(2000, 12, 1)); + expected.put("1", LocalDate.of(1980, 1, 2)); + expected.put("2", LocalDate.of(1492, 10, 12)); + assertEquals(expected, result); } @Test - public void putDateValid() throws Exception { - Map testdata = new HashMap(); - testdata.put("0", new LocalDate(2000, 12, 1)); - testdata.put("1", new LocalDate(1980, 1, 2)); - testdata.put("2", new LocalDate(1492, 10, 12)); + public void putDateValid() { + Map testdata = new HashMap<>(); + testdata.put("0", LocalDate.of(2000, 12, 1)); + testdata.put("1", LocalDate.of(1980, 1, 2)); + testdata.put("2", LocalDate.of(1492, 10, 12)); client.dictionarys().putDateValid(testdata); } @Test - public void getDateInvalidNull() throws Exception { + public void getDateInvalidNull() { Map result = client.dictionarys().getDateInvalidNull(); - Assert.assertNull(result.get("1")); + assertNull(result.get("1")); } @Test - public void getDateInvalidString() throws Exception { + public void getDateInvalidString() { try { - Map result = client.dictionarys().getDateInvalidChars(); + client.dictionarys().getDateInvalidChars(); fail(); } catch (RuntimeException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("Invalid format: \"date\"")); + assertEquals(InvalidFormatException.class, ex.getCause().getClass()); } } @Test - public void getDateTimeValid() throws Exception { - Map result = client.dictionarys().getDateTimeValid(); - Map expected = new HashMap(); - expected.put("0", new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC)); - expected.put("1", new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.forOffsetHours(1)) - .withZone(DateTimeZone.UTC)); - expected.put("2", new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.forOffsetHours(-8)) - .withZone(DateTimeZone.UTC)); - Assert.assertEquals(expected, result); + public void getDateTimeValid() { + Map result = client.dictionarys().getDateTimeValid(); + Map expected = new HashMap<>(); + expected.put("0", OffsetDateTime.of(2000, 12, 1, 0, 0, 1, 0, ZoneOffset.UTC)); + expected.put("1", OffsetDateTime.of(1980, 1, 1, 23, 11, 35, 0, ZoneOffset.UTC)); + expected.put("2", OffsetDateTime.of(1492, 10, 12, 18, 15, 1, 0, ZoneOffset.UTC)); + assertEquals(expected, result); } @Test - public void putDateTimeValid() throws Exception { - Map testdata = new HashMap(); - testdata.put("0", new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC)); - testdata.put("1", new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.forOffsetHours(1))); - testdata.put("2", new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.forOffsetHours(-8))); + public void putDateTimeValid() { + Map testdata = new HashMap<>(); + testdata.put("0", OffsetDateTime.of(2000, 12, 1, 0, 0, 1, 0, ZoneOffset.UTC)); + testdata.put("1", OffsetDateTime.of(1980, 1, 2, 0, 11, 35, 0, ZoneOffset.ofHours(1))); + testdata.put("2", OffsetDateTime.of(1492, 10, 12, 10, 15, 1, 0, ZoneOffset.ofHours(-8))); client.dictionarys().putDateTimeValid(testdata); } @Test - public void getDateTimeInvalidNull() throws Exception { - Map result = client.dictionarys().getDateTimeInvalidNull(); - Assert.assertNull(result.get("1")); + public void getDateTimeInvalidNull() { + Map result = client.dictionarys().getDateTimeInvalidNull(); + assertNull(result.get("1")); } @Test - public void getDateTimeInvalidString() throws Exception { + public void getDateTimeInvalidString() { try { - Map result = client.dictionarys().getDateTimeInvalidChars(); + client.dictionarys().getDateTimeInvalidChars(); fail(); } catch (RuntimeException ex) { - // expected - Assert.assertTrue(ex.getMessage().contains("Invalid format: \"date-time\"")); + assertEquals(InvalidFormatException.class, ex.getCause().getClass()); } } @Test - public void getDateTimeRfc1123Valid() throws Exception { - Map result = client.dictionarys().getDateTimeRfc1123Valid(); - Map expected = new HashMap(); - expected.put("0", new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC)); - expected.put("1", new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC)); - expected.put("2", new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC)); - Assert.assertEquals(expected, result); + public void getDateTimeRfc1123Valid() { + Map result = client.dictionarys().getDateTimeRfc1123Valid(); + Map expected = new HashMap<>(); + expected.put("0", OffsetDateTime.of(2000, 12, 1, 0, 0, 1, 0, ZoneOffset.UTC)); + expected.put("1", OffsetDateTime.of(1980, 1, 2, 0, 11, 35, 0, ZoneOffset.UTC)); + expected.put("2", OffsetDateTime.of(1492, 10, 12, 10, 15, 1, 0, ZoneOffset.UTC)); + assertEquals(expected, result); } @Test - public void putDateTimeRfc1123Valid() throws Exception { - Map testdata = new HashMap(); - testdata.put("0", new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC)); - testdata.put("1", new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC)); - testdata.put("2", new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC)); + public void putDateTimeRfc1123Valid() { + Map testdata = new HashMap<>(); + testdata.put("0", OffsetDateTime.of(2000, 12, 1, 0, 0, 1, 0, ZoneOffset.UTC)); + testdata.put("1", OffsetDateTime.of(1980, 1, 2, 0, 11, 35, 0, ZoneOffset.UTC)); + testdata.put("2", OffsetDateTime.of(1492, 10, 12, 10, 15, 1, 0, ZoneOffset.UTC)); client.dictionarys().putDateTimeRfc1123Valid(testdata); } @Test - public void getDurationValid() throws Exception { - Map result = client.dictionarys().getDurationValid(); - Map expected = new HashMap(); - expected.put("0", new Period(0, 0, 0, 123, 22, 14, 12, 11)); - expected.put("1", new Period(0, 0, 0, 5, 1, 0, 0, 0)); - Assert.assertEquals(expected, result); + public void getDurationValid() { + Map result = client.dictionarys().getDurationValid(); + Map expected = new HashMap<>(); + expected.put("0", Duration.ofDays(123).plusHours(22).plusMinutes(14).plusSeconds(12).plusMillis(11)); + expected.put("1", Duration.ofDays(5).plusHours(1)); + assertEquals(expected, result); } @Test - public void putDurationValid() throws Exception { - Map testdata = new HashMap(); - testdata.put("0", new Period(0, 0, 0, 123, 22, 14, 12, 11)); - testdata.put("1", new Period(0, 0, 0, 5, 1, 0, 0, 0)); + public void putDurationValid() { + Map testdata = new HashMap<>(); + testdata.put("0", Duration.ofDays(123).plusHours(22).plusMinutes(14).plusSeconds(12).plusMillis(11)); + testdata.put("1", Duration.ofDays(5).plusHours(1)); client.dictionarys().putDurationValid(testdata); } @Test - public void getByteValid() throws Exception { + public void getByteValid() { Map result = client.dictionarys().getByteValid(); - Map expected = new HashMap(); + Map expected = new HashMap<>(); expected.put("0", new byte[] {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFA}); expected.put("1", new byte[] {(byte) 0x01, (byte) 0x02, (byte) 0x03}); expected.put("2", new byte[] {(byte) 0x25, (byte) 0x29, (byte) 0x43}); - Assert.assertArrayEquals(expected.get("0"), result.get("0")); - Assert.assertArrayEquals(expected.get("1"), result.get("1")); - Assert.assertArrayEquals(expected.get("2"), result.get("2")); + assertArrayEquals(expected.get("0"), result.get("0")); + assertArrayEquals(expected.get("1"), result.get("1")); + assertArrayEquals(expected.get("2"), result.get("2")); } @Test - public void putByteValid() throws Exception { - Map testdata = new HashMap(); + public void putByteValid() { + Map testdata = new HashMap<>(); testdata.put("0", new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFA}); testdata.put("1", new byte[]{(byte) 0x01, (byte) 0x02, (byte) 0x03}); testdata.put("2", new byte[]{(byte) 0x25, (byte) 0x29, (byte) 0x43}); @@ -425,57 +415,57 @@ public void putByteValid() throws Exception { } @Test - public void getByteInvalidNull() throws Exception { + public void getByteInvalidNull() { Map result = client.dictionarys().getByteInvalidNull(); - Assert.assertNull(result.get("1")); + assertNull(result.get("1")); } @Test - public void getBase64Url() throws Exception { + public void getBase64Url() { Map result = client.dictionarys().getBase64Url(); - Assert.assertEquals("a string that gets encoded with base64url", new String(result.get("0"))); - Assert.assertEquals("test string", new String(result.get("1"))); - Assert.assertEquals("Lorem ipsum", new String(result.get("2"))); + assertEquals("a string that gets encoded with base64url", new String(result.get("0"))); + assertEquals("test string", new String(result.get("1"))); + assertEquals("Lorem ipsum", new String(result.get("2"))); } @Test - public void getComplexNull() throws Exception { + public void getComplexNull() { Map result = client.dictionarys().getComplexNull(); - Assert.assertNull(result); + assertNull(result); } @Test - public void getComplexEmpty() throws Exception { + public void getComplexEmpty() { Map result = client.dictionarys().getComplexEmpty(); - Assert.assertEquals(0, result.size()); + assertEquals(0, result.size()); } @Test - public void getComplexItemNull() throws Exception { + public void getComplexItemNull() { Map result = client.dictionarys().getComplexItemNull(); - Assert.assertEquals(3, result.size()); - Assert.assertNull(result.get("1")); + assertEquals(3, result.size()); + assertNull(result.get("1")); } @Test - public void getComplexItemEmpty() throws Exception { + public void getComplexItemEmpty() { Map result = client.dictionarys().getComplexItemEmpty(); - Assert.assertEquals(3, result.size()); - Assert.assertNull(result.get("1").integer()); - Assert.assertNull(result.get("1").stringProperty()); + assertEquals(3, result.size()); + assertNull(result.get("1").integer()); + assertNull(result.get("1").stringProperty()); } @Test - public void getComplexValid() throws Exception { + public void getComplexValid() { Map result = client.dictionarys().getComplexValid(); - Assert.assertEquals(3, result.size()); - Assert.assertEquals(1, result.get("0").integer().intValue()); - Assert.assertEquals("4", result.get("1").stringProperty()); + assertEquals(3, result.size()); + assertEquals(1, result.get("0").integer().intValue()); + assertEquals("4", result.get("1").stringProperty()); } @Test - public void putComplexValid() throws Exception { - Map body = new HashMap(); + public void putComplexValid() { + Map body = new HashMap<>(); Widget w1 = new Widget(); w1.withInteger(1); w1.withStringProperty("2"); @@ -492,40 +482,40 @@ public void putComplexValid() throws Exception { } @Test - public void getArrayNull() throws Exception { + public void getArrayNull() { Map> result = client.dictionarys().getArrayNull(); - Assert.assertNull(result); + assertNull(result); } @Test - public void getArrayEmpty() throws Exception { + public void getArrayEmpty() { Map> result = client.dictionarys().getArrayEmpty(); - Assert.assertEquals(0, result.size()); + assertEquals(0, result.size()); } @Test - public void getArrayItemNull() throws Exception { + public void getArrayItemNull() { Map> result = client.dictionarys().getArrayItemNull(); - Assert.assertNull(result.get("1")); + assertNull(result.get("1")); } @Test - public void getArrayItemEmpty() throws Exception { + public void getArrayItemEmpty() { Map> result = client.dictionarys().getArrayItemEmpty(); - Assert.assertEquals(0, result.get("1").size()); + assertEquals(0, result.get("1").size()); } @Test - public void getArrayValid() throws Exception { + public void getArrayValid() { Map> result = client.dictionarys().getArrayValid(); - Assert.assertArrayEquals(new String[] {"1", "2", "3" }, result.get("0").toArray()); - Assert.assertArrayEquals(new String[] {"4", "5", "6" }, result.get("1").toArray()); - Assert.assertArrayEquals(new String[] {"7", "8", "9" }, result.get("2").toArray()); + assertArrayEquals(new String[] {"1", "2", "3" }, result.get("0").toArray()); + assertArrayEquals(new String[] {"4", "5", "6" }, result.get("1").toArray()); + assertArrayEquals(new String[] {"7", "8", "9" }, result.get("2").toArray()); } @Test - public void putArrayValid() throws Exception { - Map> body = new HashMap>(); + public void putArrayValid() { + Map> body = new HashMap<>(); body.put("0", Arrays.asList("1", "2", "3")); body.put("1", Arrays.asList("4", "5", "6")); body.put("2", Arrays.asList("7", "8", "9")); @@ -533,65 +523,65 @@ public void putArrayValid() throws Exception { } @Test - public void getDictionaryNull() throws Exception { - Assert.assertNull(client.dictionarys().getDictionaryNull()); + public void getDictionaryNull() { + assertNull(client.dictionarys().getDictionaryNull()); } @Test - public void getDictionaryEmpty() throws Exception { + public void getDictionaryEmpty() { Map> result = client.dictionarys().getDictionaryEmpty(); - Assert.assertEquals(0, result.size()); + assertEquals(0, result.size()); } @Test - public void getDictionaryItemNull() throws Exception { + public void getDictionaryItemNull() { Map> result = client.dictionarys().getDictionaryItemNull(); - Assert.assertNull(result.get("1")); + assertNull(result.get("1")); } @Test - public void getDictionaryItemEmpty() throws Exception { + public void getDictionaryItemEmpty() { Map> result = client.dictionarys().getDictionaryItemEmpty(); - Assert.assertEquals(0, result.get("1").size()); + assertEquals(0, result.get("1").size()); } @Test - public void getDictionaryValid() throws Exception { + public void getDictionaryValid() { Map> result = client.dictionarys().getDictionaryValid(); - Map map1 = new HashMap(); + Map map1 = new HashMap<>(); map1.put("1", "one"); map1.put("2", "two"); map1.put("3", "three"); - Map map2 = new HashMap(); + Map map2 = new HashMap<>(); map2.put("4", "four"); map2.put("5", "five"); map2.put("6", "six"); - Map map3 = new HashMap(); + Map map3 = new HashMap<>(); map3.put("7", "seven"); map3.put("8", "eight"); map3.put("9", "nine"); - Map> expected = new HashMap>(); + Map> expected = new HashMap<>(); expected.put("0", map1); expected.put("1", map2); expected.put("2", map3); - Assert.assertEquals(expected, result); + assertEquals(expected, result); } @Test - public void putDictionaryValid() throws Exception { - Map map1 = new HashMap(); + public void putDictionaryValid() { + Map map1 = new HashMap<>(); map1.put("1", "one"); map1.put("2", "two"); map1.put("3", "three"); - Map map2 = new HashMap(); + Map map2 = new HashMap<>(); map2.put("4", "four"); map2.put("5", "five"); map2.put("6", "six"); - Map map3 = new HashMap(); + Map map3 = new HashMap<>(); map3.put("7", "seven"); map3.put("8", "eight"); map3.put("9", "nine"); - Map> body = new HashMap>(); + Map> body = new HashMap<>(); body.put("0", map1); body.put("1", map2); body.put("2", map3); diff --git a/test/vanilla/src/test/java/fixtures/bodyduration/DurationOperationsTests.java b/test/vanilla/src/test/java/fixtures/bodyduration/DurationOperationsTests.java index 678aa96386..a12b9472d5 100644 --- a/test/vanilla/src/test/java/fixtures/bodyduration/DurationOperationsTests.java +++ b/test/vanilla/src/test/java/fixtures/bodyduration/DurationOperationsTests.java @@ -1,12 +1,16 @@ package fixtures.bodyduration; -import org.joda.time.Period; -import org.junit.Assert; +import com.fasterxml.jackson.databind.exc.InvalidFormatException; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import fixtures.bodyduration.implementation.AutoRestDurationTestServiceImpl; +import java.time.Duration; + +import static org.junit.Assert.*; + public class DurationOperationsTests { private static AutoRestDurationTestService client; @@ -16,28 +20,30 @@ public static void setup() { } @Test - public void getNull() throws Exception { - Assert.assertNull(client.durations().getNull()); + public void getNull() { + assertNull(client.durations().getNull()); } @Test - public void getInvalid() throws Exception { + public void getInvalid() { try { client.durations().getInvalid(); - Assert.fail(); //Should not reach here + fail(); } - catch (IllegalArgumentException e) { - //Swallow exceptions + catch (RuntimeException e) { + assertEquals(InvalidFormatException.class, e.getCause().getClass()); } } @Test - public void getPositiveDuration() throws Exception { + @Ignore("The duration sent from the test server includes year and month values, which our durations don't support.") + public void getPositiveDuration() { client.durations().getPositiveDuration(); } @Test - public void putPositiveDuration() throws Exception { - client.durations().putPositiveDuration(new Period(0, 0, 0, 123, 22, 14, 12, 11)); + @Ignore("The test server expects the duration to have a year and month component, which our durations don't support.") + public void putPositiveDuration() { + client.durations().putPositiveDuration(Duration.ofDays(123).plusHours(22).plusMinutes(14).plusSeconds(12).plusMinutes(11)); } } diff --git a/test/vanilla/src/test/java/fixtures/bodyinteger/IntOperationsTests.java b/test/vanilla/src/test/java/fixtures/bodyinteger/IntOperationsTests.java index 803b6cf984..395dff4c50 100644 --- a/test/vanilla/src/test/java/fixtures/bodyinteger/IntOperationsTests.java +++ b/test/vanilla/src/test/java/fixtures/bodyinteger/IntOperationsTests.java @@ -1,26 +1,20 @@ package fixtures.bodyinteger; import com.fasterxml.jackson.core.JsonParseException; -import com.microsoft.rest.v2.RestException; import com.microsoft.rest.v2.ServiceCallback; -import com.microsoft.rest.v2.http.HttpPipeline; -import com.microsoft.rest.v2.policy.DecodingPolicyFactory; import fixtures.bodyinteger.implementation.AutoRestIntegerTestServiceImpl; import io.reactivex.Observable; import io.reactivex.Observer; import io.reactivex.disposables.Disposable; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.fail; - public class IntOperationsTests { private static AutoRestIntegerTestService client; private CountDownLatch lock = new CountDownLatch(1); @@ -31,17 +25,17 @@ public static void setup() { } @Test - public void getNull() throws Exception { + public void getNull() { try { - int i = client.ints().getNull(); - fail(); + client.ints().getNull(); + Assert.fail(); } catch (NullPointerException e) { // expected } } @Test - public void getNullAsync() throws Exception { + public void getNullAsync() { Observable.fromFuture(client.ints().getNullAsync(null)).subscribe(new Observer() { @Override public void onSubscribe(Disposable disposable) {} @@ -65,37 +59,37 @@ public void onComplete() { } @Test - public void getInvalid() throws Exception { + public void getInvalid() { try { client.ints().getInvalid(); - Assert.assertTrue(false); + Assert.fail(); } catch (Exception exception) { Assert.assertEquals(JsonParseException.class, exception.getCause().getClass()); } } @Test - public void getOverflowInt32() throws Exception { + public void getOverflowInt32() { try { client.ints().getOverflowInt32(); - Assert.assertTrue(false); + Assert.fail(); } catch (Exception exception) { Assert.assertEquals(JsonParseException.class, exception.getCause().getClass()); } } @Test - public void getUnderflowInt32() throws Exception { + public void getUnderflowInt32() { try { client.ints().getUnderflowInt32(); - Assert.assertTrue(false); + Assert.fail(); } catch (Exception exception) { Assert.assertEquals(JsonParseException.class, exception.getCause().getClass()); } } @Test - public void getOverflowInt64() throws Exception { + public void getOverflowInt64() { try { long value = client.ints().getOverflowInt64(); Assert.assertEquals(Long.MAX_VALUE, value); @@ -105,7 +99,7 @@ public void getOverflowInt64() throws Exception { } @Test - public void getUnderflowInt64() throws Exception { + public void getUnderflowInt64() { try { long value = client.ints().getUnderflowInt64(); Assert.assertEquals(Long.MIN_VALUE, value); @@ -175,29 +169,28 @@ public void success(Void response) { } @Test - public void getUnixTime() throws Exception { - DateTime result = client.ints().getUnixTime(); - Assert.assertEquals(new DateTime(2016, 4, 13, 0, 0, 0, DateTimeZone.UTC), result); + public void getUnixTime() { + OffsetDateTime result = client.ints().getUnixTime(); + Assert.assertEquals(OffsetDateTime.of(2016, 4, 13, 0, 0, 0, 0, ZoneOffset.UTC), result); } @Test - public void putUnixTimeDate() throws Exception { - client.ints().putUnixTimeDate(new DateTime(2016, 4, 13, 0, 0, 0, DateTimeZone.UTC)); + public void putUnixTimeDate() { + client.ints().putUnixTimeDate(OffsetDateTime.of(2016, 4, 13, 0, 0, 0, 0, ZoneOffset.UTC)); } @Test - public void getInvalidUnixTime() throws Exception { + public void getInvalidUnixTime() { try { client.ints().getInvalidUnixTime(); - fail(); + Assert.fail(); } catch (RuntimeException e) { Assert.assertTrue(e.getMessage().contains("HTTP response has a malformed body")); } } @Test - public void getNullUnixTime() throws Exception { - DateTime result = client.ints().getNullUnixTime(); - Assert.assertNull(result); + public void getNullUnixTime() { + Assert.assertNull(client.ints().getNullUnixTime()); } } diff --git a/test/vanilla/src/test/java/fixtures/header/HeaderOperationsTests.java b/test/vanilla/src/test/java/fixtures/header/HeaderOperationsTests.java index 49340ce38a..345a24b46e 100644 --- a/test/vanilla/src/test/java/fixtures/header/HeaderOperationsTests.java +++ b/test/vanilla/src/test/java/fixtures/header/HeaderOperationsTests.java @@ -8,15 +8,15 @@ import com.microsoft.rest.v2.policy.PortPolicyFactory; import com.microsoft.rest.v2.policy.ProtocolPolicyFactory; import org.apache.commons.codec.binary.Base64; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.joda.time.LocalDate; -import org.joda.time.Period; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import java.nio.charset.Charset; +import java.time.Duration; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; import java.util.Map; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -51,7 +51,7 @@ public static void setup() { headers.set("x-ms-client-request-id", "9C4D50EE-2D56-4CD3-8152-34347DC9F2B0"); HttpPipeline httpPipeline = new HttpPipelineBuilder() - .withUserAgent("") + .withUserAgentPolicy("") .withRequestPolicy(new AddHeadersPolicyFactory(headers)) .withRequestPolicy(new ProtocolPolicyFactory("http")) .withRequestPolicy(new PortPolicyFactory(3000)) @@ -61,7 +61,7 @@ public static void setup() { } @Test - public void paramExistingKey() throws Exception { + public void paramExistingKey() { client.headers().paramExistingKey("overwrite"); } @@ -69,26 +69,18 @@ public void paramExistingKey() throws Exception { public void responseExistingKey() throws Exception { lock = new CountDownLatch(1); client.headers().responseExistingKeyWithRestResponseAsync() - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("User-Agent") != null) { - Assert.assertEquals("overwrite", headers.get("User-Agent")); - lock.countDown(); - } + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("User-Agent") != null) { + Assert.assertEquals("overwrite", headers.get("User-Agent")); + lock.countDown(); } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); - } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); } @Test - public void paramProtectedKey() throws Exception { + public void paramProtectedKey() { try { client.headers().paramProtectedKey("text/html"); } catch (RuntimeException ex) { @@ -100,26 +92,18 @@ public void paramProtectedKey() throws Exception { public void responseProtectedKey() throws Exception { lock = new CountDownLatch(1); client.headers().responseProtectedKeyWithRestResponseAsync() - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("Content-Type") != null) { - Assert.assertTrue(headers.get("Content-Type").contains("text/html")); - lock.countDown(); - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("Content-Type") != null) { + Assert.assertTrue(headers.get("Content-Type").contains("text/html")); + lock.countDown(); } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); } @Test - public void paramInteger() throws Exception { + public void paramInteger() { client.headers().paramInteger("positive", 1); client.headers().paramInteger("negative", -2); } @@ -128,44 +112,28 @@ public void paramInteger() throws Exception { public void responseInteger() throws Exception { lock = new CountDownLatch(1); client.headers().responseIntegerWithRestResponseAsync("positive") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("1", headers.get("value")); - lock.countDown(); - } + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("1", headers.get("value")); + lock.countDown(); } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); - } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(10000, TimeUnit.MILLISECONDS)); lock = new CountDownLatch(1); client.headers().responseIntegerWithRestResponseAsync("negative") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("-2", headers.get("value")); - lock.countDown(); - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("-2", headers.get("value")); + lock.countDown(); } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(10000, TimeUnit.MILLISECONDS)); } @Test - public void paramLong() throws Exception { + public void paramLong() { client.headers().paramLong("positive", 105); client.headers().paramLong("negative", -2); } @@ -174,44 +142,28 @@ public void paramLong() throws Exception { public void responseLong() throws Exception { lock = new CountDownLatch(1); client.headers().responseLongWithRestResponseAsync("positive") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("105", headers.get("value")); - lock.countDown(); - } + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("105", headers.get("value")); + lock.countDown(); } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); - } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); lock = new CountDownLatch(1); client.headers().responseLongWithRestResponseAsync("negative") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("-2", headers.get("value")); - lock.countDown(); - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("-2", headers.get("value")); + lock.countDown(); } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); } @Test - public void paramFloat() throws Exception { + public void paramFloat() { client.headers().paramFloat("positive", 0.07); client.headers().paramFloat("negative", -3.0); } @@ -220,44 +172,28 @@ public void paramFloat() throws Exception { public void responseFloat() throws Exception { lock = new CountDownLatch(1); client.headers().responseFloatWithRestResponseAsync("positive") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("0.07", headers.get("value")); - lock.countDown(); - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("0.07", headers.get("value")); + lock.countDown(); } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); lock = new CountDownLatch(1); client.headers().responseFloatWithRestResponseAsync("negative") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("-3", headers.get("value")); - lock.countDown(); - } + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("-3", headers.get("value")); + lock.countDown(); } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); - } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); } @Test - public void paramDouble() throws Exception { + public void paramDouble() { client.headers().paramDouble("positive", 7e120); client.headers().paramDouble("negative", -3.0); } @@ -266,44 +202,28 @@ public void paramDouble() throws Exception { public void responseDouble() throws Exception { lock = new CountDownLatch(1); client.headers().responseDoubleWithRestResponseAsync("positive") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("7e+120", headers.get("value")); - lock.countDown(); - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("7e+120", headers.get("value")); + lock.countDown(); } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); lock = new CountDownLatch(1); client.headers().responseDoubleWithRestResponseAsync("negative") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("-3", headers.get("value")); - lock.countDown(); - } + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("-3", headers.get("value")); + lock.countDown(); } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); - } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); } @Test - public void paramBool() throws Exception { + public void paramBool() { client.headers().paramBool("true", true); client.headers().paramBool("false", false); } @@ -312,44 +232,28 @@ public void paramBool() throws Exception { public void responseBool() throws Exception { lock = new CountDownLatch(1); client.headers().responseBoolWithRestResponseAsync("true") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("true", headers.get("value")); - lock.countDown(); - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("true", headers.get("value")); + lock.countDown(); } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); lock = new CountDownLatch(1); client.headers().responseBoolWithRestResponseAsync("false") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("false", headers.get("value")); - lock.countDown(); - } + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("false", headers.get("value")); + lock.countDown(); } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); - } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); } @Test - public void paramString() throws Exception { + public void paramString() { client.headers().paramString("valid", "The quick brown fox jumps over the lazy dog"); client.headers().paramString("null", null); client.headers().paramString("empty", ""); @@ -359,228 +263,148 @@ public void paramString() throws Exception { public void responseString() throws Exception { lock = new CountDownLatch(1); client.headers().responseStringWithRestResponseAsync("valid") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("The quick brown fox jumps over the lazy dog", headers.get("value")); - lock.countDown(); - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("The quick brown fox jumps over the lazy dog", headers.get("value")); + lock.countDown(); } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); lock = new CountDownLatch(1); client.headers().responseStringWithRestResponseAsync("null") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("null", headers.get("value")); - lock.countDown(); - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("null", headers.get("value")); + lock.countDown(); } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); lock = new CountDownLatch(1); client.headers().responseStringWithRestResponseAsync("empty") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("", headers.get("value")); - lock.countDown(); - } + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("", headers.get("value")); + lock.countDown(); } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); - } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); } @Test - public void paramDate() throws Exception { - client.headers().paramDate("valid", new LocalDate(2010, 1, 1)); - client.headers().paramDate("min", new LocalDate(1, 1, 1)); + public void paramDate() { + client.headers().paramDate("valid", LocalDate.of(2010, 1, 1)); + client.headers().paramDate("min", LocalDate.of(1, 1, 1)); } @Test public void responseDate() throws Exception { lock = new CountDownLatch(1); client.headers().responseDateWithRestResponseAsync("valid") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("2010-01-01", headers.get("value")); - lock.countDown(); - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("2010-01-01", headers.get("value")); + lock.countDown(); } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); lock = new CountDownLatch(1); client.headers().responseDateWithRestResponseAsync("min") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("0001-01-01", headers.get("value")); - lock.countDown(); - } + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("0001-01-01", headers.get("value")); + lock.countDown(); } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); - } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); } @Test - public void paramDuration() throws Exception { - client.headers().paramDuration("valid", new Period(0, 0, 0, 123, 22, 14, 12, 11)); + public void paramDuration() { + client.headers().paramDuration("valid", Duration.ofDays(123).plusHours(22).plusMinutes(14).plusSeconds(12).plusMillis(11)); } @Test public void responseDuration() throws Exception { lock = new CountDownLatch(1); client.headers().responseDurationWithRestResponseAsync("valid") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("P123DT22H14M12.011S", headers.get("value")); - lock.countDown(); - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("P123DT22H14M12.011S", headers.get("value")); + lock.countDown(); } - }); + }, (Throwable throwable) -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); } @Test - public void paramDatetimeRfc1123() throws Exception { - client.headers().paramDatetimeRfc1123("valid", new DateTime(2010, 1, 1, 12, 34, 56, DateTimeZone.UTC)); - client.headers().paramDatetimeRfc1123("min", new DateTime(1, 1, 1, 0, 0, 0, DateTimeZone.UTC)); + public void paramDatetimeRfc1123() { + client.headers().paramDatetimeRfc1123("valid", OffsetDateTime.of(2010, 1, 1, 12, 34, 56, 0, ZoneOffset.UTC)); + client.headers().paramDatetimeRfc1123("min", OffsetDateTime.of(1, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)); } @Test public void responseDatetimeRfc1123() throws Exception { lock = new CountDownLatch(1); client.headers().responseDatetimeRfc1123WithRestResponseAsync("valid") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("Fri, 01 Jan 2010 12:34:56 GMT", headers.get("value")); - lock.countDown(); - } + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("Fri, 01 Jan 2010 12:34:56 GMT", headers.get("value")); + lock.countDown(); } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); - } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(100000, TimeUnit.MILLISECONDS)); lock = new CountDownLatch(1); client.headers().responseDatetimeRfc1123WithRestResponseAsync("min") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("Mon, 01 Jan 0001 00:00:00 GMT", headers.get("value")); - lock.countDown(); - - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("Mon, 01 Jan 0001 00:00:00 GMT", headers.get("value")); + lock.countDown(); + } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); } @Test - public void paramDatetime() throws Exception { - client.headers().paramDatetime("valid", new DateTime(2010, 1, 1, 12, 34, 56, DateTimeZone.UTC)); - client.headers().paramDatetime("min", new DateTime(1, 1, 1, 0, 0, 0, DateTimeZone.UTC)); + public void paramDatetime() { + client.headers().paramDatetime("valid", OffsetDateTime.of(2010, 1, 1, 12, 34, 56, 0, ZoneOffset.UTC)); + client.headers().paramDatetime("min", OffsetDateTime.of(1, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)); } @Test public void responseDatetime() throws Exception { lock = new CountDownLatch(1); client.headers().responseDatetimeWithRestResponseAsync("valid") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("2010-01-01T12:34:56Z", headers.get("value")); - lock.countDown(); - } + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("2010-01-01T12:34:56Z", headers.get("value")); + lock.countDown(); } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); - } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); lock = new CountDownLatch(1); client.headers().responseDatetimeWithRestResponseAsync("min") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("0001-01-01T00:00:00Z", headers.get("value")); - lock.countDown(); - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("0001-01-01T00:00:00Z", headers.get("value")); + lock.countDown(); } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); } @Test - public void paramByte() throws Exception { + public void paramByte() { client.headers().paramByte("valid", "啊齄丂狛狜隣郎隣兀﨩".getBytes(Charset.forName("UTF-8"))); } @@ -588,28 +412,20 @@ public void paramByte() throws Exception { public void responseByte() throws Exception { lock = new CountDownLatch(1); client.headers().responseByteWithRestResponseAsync("valid") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - byte[] value = Base64.decodeBase64(headers.get("value")); - String actual = new String(value, Charset.forName("UTF-8")); - Assert.assertEquals("啊齄丂狛狜隣郎隣兀﨩", actual); - lock.countDown(); - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); - } - }); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + byte[] value = Base64.decodeBase64(headers.get("value")); + String actual = new String(value, Charset.forName("UTF-8")); + Assert.assertEquals("啊齄丂狛狜隣郎隣兀﨩", actual); + lock.countDown(); + } + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); } @Test - public void paramEnum() throws Exception { + public void paramEnum() { client.headers().paramEnum("valid", GreyscaleColors.GREY); client.headers().paramEnum("null", null); } @@ -618,44 +434,28 @@ public void paramEnum() throws Exception { public void responseEnum() throws Exception { lock = new CountDownLatch(1); client.headers().responseEnumWithRestResponseAsync("valid") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("GREY", headers.get("value")); - lock.countDown(); - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("GREY", headers.get("value")); + lock.countDown(); } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); lock = new CountDownLatch(1); client.headers().responseEnumWithRestResponseAsync("null") - .subscribe(new Consumer>() { - @Override - public void accept(RestResponse response) { - Map headers = response.rawHeaders(); - if (headers.get("value") != null) { - Assert.assertEquals("", headers.get("value")); - lock.countDown(); - } - } - }, new Consumer() { - @Override - public void accept(Throwable throwable) { - fail(); + .subscribe((Consumer>) response -> { + Map headers = response.rawHeaders(); + if (headers.get("value") != null) { + Assert.assertEquals("", headers.get("value")); + lock.countDown(); } - }); + }, throwable -> fail()); Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); } @Test - public void customRequestId() throws Exception { + public void customRequestId() { client.headers().customRequestId(); } } diff --git a/test/vanilla/src/test/java/fixtures/url/PathsTests.java b/test/vanilla/src/test/java/fixtures/url/PathsTests.java index c601a5cc58..ee867f2e62 100644 --- a/test/vanilla/src/test/java/fixtures/url/PathsTests.java +++ b/test/vanilla/src/test/java/fixtures/url/PathsTests.java @@ -4,11 +4,12 @@ import com.microsoft.rest.v2.policy.DecodingPolicyFactory; import fixtures.url.implementation.AutoRestUrlTestServiceImpl; import fixtures.url.models.UriColor; -import org.joda.time.DateTime; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import java.time.OffsetDateTime; + public class PathsTests { private static AutoRestUrlTestService client; @@ -166,6 +167,6 @@ public void arrayCsvInPath() throws Exception { @Test public void unixTimeUrl() throws Exception { - client.paths().unixTimeUrl(DateTime.parse("2016-04-13T00:00:00Z")); + client.paths().unixTimeUrl(OffsetDateTime.parse("2016-04-13T00:00:00Z")); } } diff --git a/test/xml/src/main/java/fixtures/xml/models/Banana.java b/test/xml/src/main/java/fixtures/xml/models/Banana.java index 0243d55c7d..6d65d3ef98 100644 --- a/test/xml/src/main/java/fixtures/xml/models/Banana.java +++ b/test/xml/src/main/java/fixtures/xml/models/Banana.java @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import org.joda.time.DateTime; +import java.time.OffsetDateTime; /** * A banana. @@ -36,7 +36,7 @@ public final class Banana { * The time at which you should reconsider eating this banana. */ @JsonProperty(value = "expiration") - private DateTime expiration; + private OffsetDateTime expiration; /** * Get the name value. @@ -83,7 +83,7 @@ public Banana withFlavor(String flavor) { * * @return the expiration value. */ - public DateTime expiration() { + public OffsetDateTime expiration() { return this.expiration; } @@ -93,7 +93,7 @@ public DateTime expiration() { * @param expiration the expiration value to set. * @return the Banana object itself. */ - public Banana withExpiration(DateTime expiration) { + public Banana withExpiration(OffsetDateTime expiration) { this.expiration = expiration; return this; } diff --git a/test/xml/src/test/java/fixtures/xml/XmlsTests.java b/test/xml/src/test/java/fixtures/xml/XmlsTests.java index 47df5f815e..82d33ee373 100644 --- a/test/xml/src/test/java/fixtures/xml/XmlsTests.java +++ b/test/xml/src/test/java/fixtures/xml/XmlsTests.java @@ -104,11 +104,11 @@ public void getRootList() { assertEquals("Cavendish", bananas.get(0).name()); assertEquals("Sweet", bananas.get(0).flavor()); - assertEquals("2018-02-28T00:40:00.000Z", bananas.get(0).expiration().toString()); + assertEquals("2018-02-28T00:40Z", bananas.get(0).expiration().toString()); assertEquals("Plantain", bananas.get(1).name()); assertEquals("Savory", bananas.get(1).flavor()); - assertEquals("2018-02-28T00:40:00.000Z", bananas.get(1).expiration().toString()); + assertEquals("2018-02-28T00:40Z", bananas.get(1).expiration().toString()); } @Test diff --git a/test/xml/src/test/resources/GetXMLRootList.xml b/test/xml/src/test/resources/GetXMLRootList.xml index 595fc0b51e..3e764265ba 100644 --- a/test/xml/src/test/resources/GetXMLRootList.xml +++ b/test/xml/src/test/resources/GetXMLRootList.xml @@ -3,11 +3,11 @@ Cavendish Sweet - 2018-02-28T00:40:00.000Z + 2018-02-28T00:40:00Z Plantain Savory - 2018-02-28T00:40:00.000Z + 2018-02-28T00:40:00Z