use of org.graylog2.shared.rest.documentation.generator.Generator in project graylog2-server by Graylog2.
the class GeneratorTest method testGenerateOverview.
@Test
public void testGenerateOverview() throws Exception {
Generator generator = new Generator("org.graylog2.rest.resources", objectMapper);
Map<String, Object> result = generator.generateOverview();
assertEquals(ServerVersion.VERSION.toString(), result.get("apiVersion"));
assertEquals(Generator.EMULATED_SWAGGER_VERSION, result.get("swaggerVersion"));
assertNotNull(result.get("apis"));
assertTrue(((List) result.get("apis")).size() > 0);
}
use of org.graylog2.shared.rest.documentation.generator.Generator in project graylog2-server by Graylog2.
the class GeneratorTest method testGenerateForRoute.
@Test
public void testGenerateForRoute() throws Exception {
Generator generator = new Generator("org.graylog2.rest.resources", objectMapper);
Map<String, Object> result = generator.generateForRoute("/system", "http://localhost:12900/");
}
use of org.graylog2.shared.rest.documentation.generator.Generator in project graylog2-server by Graylog2.
the class RandomMessageTransport method produceRawMessage.
@Override
protected RawMessage produceRawMessage(MessageInput input) {
final byte[] payload;
try {
final FakeHttpRawMessageGenerator.GeneratorState state = generator.generateState();
payload = objectMapper.writeValueAsBytes(state);
final RawMessage raw = new RawMessage(payload);
sleepUninterruptibly(rateDeviation(sleepMs, maxSleepDeviation, rand), MILLISECONDS);
return raw;
} catch (JsonProcessingException e) {
log.error("Unable to serialize generator state", e);
}
return null;
}
Aggregations