Search in sources :

Example 1 with RegistrationRequest

use of org.graylog.plugins.sidecar.rest.requests.RegistrationRequest in project graylog2-server by Graylog2.

the class SidecarResourceTest method testRegisterMissingOperatingSystem.

@Test
@Ignore
public void testRegisterMissingOperatingSystem() throws Exception {
    final RegistrationRequest invalid = RegistrationRequest.create("nodeName", NodeDetails.create("", null, null, null, null));
    final Response response = this.resource.register("sidecarId", invalid, "0.0.1");
    assertThat(response).isError();
    assertThat(response).isStatus(Response.Status.BAD_REQUEST);
}
Also used : Response(javax.ws.rs.core.Response) RegistrationRequest(org.graylog.plugins.sidecar.rest.requests.RegistrationRequest) Ignore(org.junit.Ignore) RestResourceBaseTest(org.graylog.plugins.sidecar.collectors.rest.resources.RestResourceBaseTest) Test(org.junit.Test)

Example 2 with RegistrationRequest

use of org.graylog.plugins.sidecar.rest.requests.RegistrationRequest in project graylog2-server by Graylog2.

the class SidecarResourceTest method testRegisterInvalidCollectorId.

@Test
@Ignore
public void testRegisterInvalidCollectorId() throws Exception {
    final RegistrationRequest invalid = RegistrationRequest.create("nodeName", NodeDetails.create("DummyOS 1.0", null, null, null, null));
    final Response response = this.resource.register("", invalid, "0.0.1");
    assertThat(response).isError();
    assertThat(response).isStatus(Response.Status.BAD_REQUEST);
}
Also used : Response(javax.ws.rs.core.Response) RegistrationRequest(org.graylog.plugins.sidecar.rest.requests.RegistrationRequest) Ignore(org.junit.Ignore) RestResourceBaseTest(org.graylog.plugins.sidecar.collectors.rest.resources.RestResourceBaseTest) Test(org.junit.Test)

Example 3 with RegistrationRequest

use of org.graylog.plugins.sidecar.rest.requests.RegistrationRequest in project graylog2-server by Graylog2.

the class SidecarResourceTest method testRegisterMissingNodeDetails.

@Test
@Ignore
public void testRegisterMissingNodeDetails() throws Exception {
    final RegistrationRequest invalid = RegistrationRequest.create("nodeName", null);
    final Response response = this.resource.register("sidecarId", invalid, "0.0.1");
    assertThat(response).isError();
    assertThat(response).isStatus(Response.Status.BAD_REQUEST);
}
Also used : Response(javax.ws.rs.core.Response) RegistrationRequest(org.graylog.plugins.sidecar.rest.requests.RegistrationRequest) Ignore(org.junit.Ignore) RestResourceBaseTest(org.graylog.plugins.sidecar.collectors.rest.resources.RestResourceBaseTest) Test(org.junit.Test)

Example 4 with RegistrationRequest

use of org.graylog.plugins.sidecar.rest.requests.RegistrationRequest in project graylog2-server by Graylog2.

the class SidecarResourceTest method testRegisterInvalidNodeId.

@Test
@Ignore
public void testRegisterInvalidNodeId() throws Exception {
    final RegistrationRequest invalid = RegistrationRequest.create("", NodeDetails.create("DummyOS 1.0", null, null, null, null));
    final Response response = this.resource.register("sidecarId", invalid, "0.0.1");
    assertThat(response).isError();
    assertThat(response).isStatus(Response.Status.BAD_REQUEST);
}
Also used : Response(javax.ws.rs.core.Response) RegistrationRequest(org.graylog.plugins.sidecar.rest.requests.RegistrationRequest) Ignore(org.junit.Ignore) RestResourceBaseTest(org.graylog.plugins.sidecar.collectors.rest.resources.RestResourceBaseTest) Test(org.junit.Test)

Example 5 with RegistrationRequest

use of org.graylog.plugins.sidecar.rest.requests.RegistrationRequest in project graylog2-server by Graylog2.

the class SidecarResourceTest method testRegister.

@Test
public void testRegister() throws Exception {
    final RegistrationRequest input = RegistrationRequest.create("nodeName", NodeDetails.create("DummyOS 1.0", null, null, null, null));
    final Response response = this.resource.register("sidecarId", input, "0.0.1");
    assertThat(response).isSuccess();
}
Also used : Response(javax.ws.rs.core.Response) RegistrationRequest(org.graylog.plugins.sidecar.rest.requests.RegistrationRequest) RestResourceBaseTest(org.graylog.plugins.sidecar.collectors.rest.resources.RestResourceBaseTest) Test(org.junit.Test)

Aggregations

Response (javax.ws.rs.core.Response)5 RestResourceBaseTest (org.graylog.plugins.sidecar.collectors.rest.resources.RestResourceBaseTest)5 RegistrationRequest (org.graylog.plugins.sidecar.rest.requests.RegistrationRequest)5 Test (org.junit.Test)5 Ignore (org.junit.Ignore)4