Skip to content

Commit

Permalink
Issue OpenAPITools#795: Add microprofile OpenAPI annotations for quar…
Browse files Browse the repository at this point in the history
…kus library in JaxRsSpec
  • Loading branch information
Nuno Borges authored and Nuno Borges committed May 3, 2023
1 parent bb34ac2 commit 69ae6df
Showing 1 changed file with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4171,7 +4171,10 @@ public void testArraySchemaWithIneffectiveConstraints() {
CodegenModel cm = codegen.fromModel(modelName, sc);


List<ILoggingEvent> logsList = listAppender.list;
List<ILoggingEvent> logsList = listAppender.list.stream()
.filter(log -> Objects.equals(log.getThreadName(), Thread.currentThread().getName()))
.collect(Collectors.toList());


// JUnit assertions
assertEquals(16, logsList.size());
Expand Down Expand Up @@ -4213,7 +4216,9 @@ public void testObjectSchemaWithIneffectiveConstraints() {
Schema sc = openAPI.getComponents().getSchemas().get(modelName);
CodegenModel cm = codegen.fromModel(modelName, sc);

List<ILoggingEvent> logsList = listAppender.list;
List<ILoggingEvent> logsList = listAppender.list.stream()
.filter(log -> Objects.equals(log.getThreadName(), Thread.currentThread().getName()))
.collect(Collectors.toList());

// JUnit assertions
assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()), 9, logsList.size());
Expand Down Expand Up @@ -4257,10 +4262,12 @@ public void testStringSchemaWithIneffectiveConstraints() {
Schema sc = openAPI.getComponents().getSchemas().get(modelName);
CodegenModel cm = codegen.fromModel(modelName, sc);

List<ILoggingEvent> logsList = listAppender.list;
List<ILoggingEvent> logsList = listAppender.list.stream()
.filter(log -> Objects.equals(log.getThreadName(), Thread.currentThread().getName()))
.collect(Collectors.toList());

// JUnit assertions
assertEquals(8, logsList.size());
assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()),8, logsList.size());
assertEquals("Validation 'minItems' has no effect on schema 'string'. Ignoring!", logsList.get(0)
.getMessage());
assertEquals("Validation 'maxItems' has no effect on schema 'string'. Ignoring!", logsList.get(1)
Expand Down Expand Up @@ -4299,10 +4306,12 @@ public void testIntegerSchemaWithIneffectiveConstraints() {
Schema sc = openAPI.getComponents().getSchemas().get(modelName);
CodegenModel cm = codegen.fromModel(modelName, sc);

List<ILoggingEvent> logsList = listAppender.list;
List<ILoggingEvent> logsList = listAppender.list.stream()
.filter(log -> Objects.equals(log.getThreadName(), Thread.currentThread().getName()))
.collect(Collectors.toList());

// JUnit assertions
assertEquals(8, logsList.size());
assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()),8, logsList.size());
assertEquals("Validation 'minItems' has no effect on schema 'integer'. Ignoring!", logsList.get(0)
.getMessage());
assertEquals("Validation 'maxItems' has no effect on schema 'integer'. Ignoring!", logsList.get(1)
Expand Down Expand Up @@ -4341,10 +4350,12 @@ public void testAnySchemaWithIneffectiveConstraints() {
Schema sc = openAPI.getComponents().getSchemas().get(modelName);
CodegenModel cm = codegen.fromModel(modelName, sc);

List<ILoggingEvent> logsList = listAppender.list;
List<ILoggingEvent> logsList = listAppender.list.stream()
.filter(log -> Objects.equals(log.getThreadName(), Thread.currentThread().getName()))
.collect(Collectors.toList());

// JUnit assertions
assertEquals(0, logsList.size());
assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()),0, logsList.size());
}

@Test
Expand All @@ -4364,7 +4375,9 @@ public void testBooleanSchemaWithIneffectiveConstraints() {
Schema sc = openAPI.getComponents().getSchemas().get(modelName);
CodegenModel cm = codegen.fromModel(modelName, sc);

List<ILoggingEvent> logsList = listAppender.list;
List<ILoggingEvent> logsList = listAppender.list.stream()
.filter(log -> Objects.equals(log.getThreadName(), Thread.currentThread().getName()))
.collect(Collectors.toList());

// JUnit assertions
assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()), 11, logsList.size());
Expand Down Expand Up @@ -4412,7 +4425,9 @@ public void testNullSchemaWithIneffectiveConstraints() {
Schema sc = openAPI.getComponents().getSchemas().get(modelName);
CodegenModel cm = codegen.fromModel(modelName, sc);

List<ILoggingEvent> logsList = listAppender.list;
List<ILoggingEvent> logsList = listAppender.list.stream()
.filter(log -> Objects.equals(log.getThreadName(), Thread.currentThread().getName()))
.collect(Collectors.toList());

// JUnit assertions
assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()), 0, logsList.size());
Expand Down

0 comments on commit 69ae6df

Please sign in to comment.