-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d21eb2
commit ba54719
Showing
4 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...tlp/src/test/java/io/aklivity/zilla/runtime/exporter/otlp/internal/config/SchemaTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright 2021-2023 Aklivity Inc | ||
* | ||
* Licensed under the Aklivity Community License (the "License"); you may not use | ||
* this file except in compliance with the License. You may obtain a copy of the | ||
* License at | ||
* | ||
* https://www.aklivity.io/aklivity-community-license/ | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
package io.aklivity.zilla.runtime.exporter.otlp.internal.config; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.not; | ||
import static org.hamcrest.Matchers.nullValue; | ||
|
||
import jakarta.json.JsonObject; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
import io.aklivity.zilla.specs.engine.config.ConfigSchemaRule; | ||
|
||
public class SchemaTest | ||
{ | ||
@Rule | ||
public final ConfigSchemaRule schema = new ConfigSchemaRule() | ||
.schemaPatch("io/aklivity/zilla/specs/exporter/otlp/schema/otlp.schema.patch.json") | ||
.schemaPatch("io/aklivity/zilla/specs/engine/schema/binding/test.schema.patch.json") | ||
.schemaPatch("io/aklivity/zilla/specs/engine/schema/metrics/test.schema.patch.json") | ||
.configurationRoot("io/aklivity/zilla/specs/exporter/otlp/config"); | ||
|
||
@Test | ||
public void shouldValidateEvent() | ||
{ | ||
JsonObject config = schema.validate("event.yaml"); | ||
|
||
assertThat(config, not(nullValue())); | ||
} | ||
|
||
@Test | ||
public void shouldValidateMetrics() | ||
{ | ||
JsonObject config = schema.validate("metrics.yaml"); | ||
|
||
assertThat(config, not(nullValue())); | ||
} | ||
} |