Search in sources :

Example 1 with LookupResponse

use of fish.payara.ejb.http.protocol.LookupResponse in project Payara by payara.

the class EjbOverHttpResourceTest method lookup_SuccessFullName.

@Test
public void lookup_SuccessFullName() {
    LookupResponse response = lookupExpectSuccess(mediaType, "java:global/myapp/CalculatorBean!" + RemoteCalculator.class.getName());
    assertEquals(RemoteCalculator.class.getName(), response.typeName);
    assertEquals("Stateless", response.kind);
}
Also used : LookupResponse(fish.payara.ejb.http.protocol.LookupResponse) Test(org.junit.Test)

Example 2 with LookupResponse

use of fish.payara.ejb.http.protocol.LookupResponse in project Payara by payara.

the class EjbOverHttpResourceTest method lookupExpectSuccess.

private static LookupResponse lookupExpectSuccess(String mediaType, String jndiName) {
    Entity<LookupRequest> entity = lookupBody(mediaType, jndiName);
    try (Response response = target.path("jndi/lookup").request(mediaType).buildPost(entity).invoke()) {
        assertNoError(response, Status.CREATED);
        assertThat(response.getLocation().getPath(), endsWith("/jndi/invoke"));
        return response.readEntity(LookupResponse.class);
    }
}
Also used : Response(javax.ws.rs.core.Response) ErrorResponse(fish.payara.ejb.http.protocol.ErrorResponse) LookupResponse(fish.payara.ejb.http.protocol.LookupResponse) InvokeMethodResponse(fish.payara.ejb.http.protocol.InvokeMethodResponse) LookupRequest(fish.payara.ejb.http.protocol.LookupRequest)

Example 3 with LookupResponse

use of fish.payara.ejb.http.protocol.LookupResponse in project Payara by payara.

the class EjbOverHttpResourceTest method lookup_SuccessInterfaceName.

@Test
public void lookup_SuccessInterfaceName() {
    LookupResponse response = lookupExpectSuccess(mediaType, EJB_NAME);
    assertEquals(RemoteCalculator.class.getName(), response.typeName);
    assertEquals("Stateless", response.kind);
}
Also used : LookupResponse(fish.payara.ejb.http.protocol.LookupResponse) Test(org.junit.Test)

Aggregations

LookupResponse (fish.payara.ejb.http.protocol.LookupResponse)3 Test (org.junit.Test)2 ErrorResponse (fish.payara.ejb.http.protocol.ErrorResponse)1 InvokeMethodResponse (fish.payara.ejb.http.protocol.InvokeMethodResponse)1 LookupRequest (fish.payara.ejb.http.protocol.LookupRequest)1 Response (javax.ws.rs.core.Response)1