Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.x Enable tests that were disabled during renaming to jakarta packages work #7949

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021 Oracle and/or its affiliates.
* Copyright (c) 2020, 2023 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,8 @@

package io.helidon.examples.integrations.micronaut.data;

import jakarta.validation.ConstraintViolationException;
import javax.validation.ConstraintViolationException;

import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@

package io.helidon.examples.integrations.micronaut.data;

import javax.validation.constraints.Pattern;

import io.helidon.examples.integrations.micronaut.data.model.Pet;

import jakarta.inject.Inject;
import jakarta.validation.constraints.Pattern;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.NotFoundException;
import jakarta.ws.rs.Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@
import jakarta.json.JsonObject;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.Response;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

@HelidonTest
@Disabled("3.0.0-JAKARTA") // Micronaut - validation Error instantiating bean of type
// [io.helidon.examples.integrations.micronaut.data.DbPopulateData$ApplicationEventListener$init1$Intercepted]:
// Error loading bean [io.micronaut.validation.ValidatingInterceptor]: javax/validation/Validator
class MicronautExampleTest {
@Inject
private WebTarget webTarget;
Expand Down
5 changes: 5 additions & 0 deletions examples/microprofile/cors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
<artifactId>helidon-webclient</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.helidon.http.media</groupId>
<artifactId>helidon-http-media-jsonb</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ public GreetingMessage getMessage(@PathParam("name") String name) {
@PUT
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@RequestBody(name = "greeting",
@RequestBody(name = "message",
required = true,
content = @Content(mediaType = "application/json",
schema = @Schema(type = SchemaType.OBJECT, requiredProperties = { "greeting" })))
schema = @Schema(type = SchemaType.OBJECT, requiredProperties = { "message" })))
@APIResponses({
@APIResponse(name = "normal", responseCode = "204", description = "Greeting updated"),
@APIResponse(name = "missing 'greeting'", responseCode = "400",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import io.helidon.http.HeaderNames;
import io.helidon.http.Headers;
import io.helidon.http.Method;
import io.helidon.http.media.jsonb.JsonbSupport;
import io.helidon.microprofile.server.Server;
import io.helidon.webclient.http1.Http1Client;
import io.helidon.webclient.http1.Http1ClientRequest;
Expand All @@ -46,16 +47,15 @@
import static org.hamcrest.Matchers.not;

@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@Disabled("3.0.0-JAKARTA") // OpenAPI: Caused by: java.lang.NoSuchMethodError:
// 'java.util.List io.smallrye.jandex.ClassInfo.unsortedFields()'
public class TestCORS {

private static Http1Client client;
private static Server server;

@BeforeAll
static void init() {
Config serverConfig = Config.create().get("server");
Config config = Config.create();
Config serverConfig = config.get("server");
Server.Builder serverBuilder = Server.builder();
serverConfig.ifExists(serverBuilder::config);
server = serverBuilder
Expand All @@ -64,6 +64,7 @@ static void init() {
.start();
client = Http1Client.builder()
.baseUri("http://localhost:" + server.port())
.addMediaSupport(JsonbSupport.create(config))
.build();
}

Expand Down Expand Up @@ -184,7 +185,7 @@ void testNamedGreetWithCors() {
@Test
void testGreetingChangeWithCorsAndOtherOrigin() {
Http1ClientRequest req = client.put()
.header(HeaderNames.ORIGIN, "http://foo.com")
.header(HeaderNames.ORIGIN, "http://other.com")
.header(HeaderNames.HOST, "here.com");

try (Http1ClientResponse r = putResponse("/greet/greeting", "Ahoy", req)) {
Expand Down Expand Up @@ -213,7 +214,7 @@ private static String fromPayload(Http1ClientResponse response) {
}

private static GreetingMessage toPayload(String message) {
return new GreetingMessage(message);
return new GreetingMessage(message);
}

private static Http1ClientResponse putResponse(String path, String message) {
Expand Down