Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mnhock authored and mnhock committed Dec 8, 2023
1 parent 1733272 commit d08e2e7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.enofex.naikan.model.deserializer;


import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertTrue;

import com.enofex.naikan.model.deserializer.json.DefaultJsonDeserializer;
Expand All @@ -12,6 +13,6 @@ class DeserializerFactoryTest {
void shouldReturnJsonDeserializer() {
Deserializer deserializer = DeserializerFactory.newJsonDeserializer();

assertTrue(deserializer instanceof DefaultJsonDeserializer);
assertInstanceOf(DefaultJsonDeserializer.class, deserializer);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.enofex.naikan.model.serializer;


import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertTrue;

import com.enofex.naikan.model.BomSchema;
Expand All @@ -13,6 +14,6 @@ class SerializerFactoryTest {
void shouldReturnJsonSerializer() {
Serializer serializer = SerializerFactory.newJsonSerializer(BomSchema.Version.VERSION_10);

assertTrue(serializer instanceof JsonSerializer);
assertInstanceOf(JsonSerializer.class, serializer);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import static com.enofex.naikan.test.model.Boms.validBom0asInputStream;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertTrue;

import com.enofex.naikan.model.Bom;
Expand Down Expand Up @@ -41,7 +42,7 @@ void shouldBeValid() {

JsonSerializer serializer = (JsonSerializer) SerializerFactory.newJsonSerializer(
BomSchema.Version.VERSION_10);
assertTrue(serializer instanceof JsonSerializer10);
assertInstanceOf(JsonSerializer10.class, serializer);
assertEquals(BomSchema.Version.VERSION_10, serializer.getSchemaVersion());

File file = serializer.toFile(bom, this.tempFile.getAbsolutePath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ Collection<DynamicTest> dynamicTestsWithCollection() throws Exception {
for (BomFile file : files) {
if (file.name().endsWith(".json")) {

if (file.name().startsWith("valid") && schemaVersion != null) {
if (file.name().startsWith("valid")) {
dynamicTests.add(
DynamicTest.dynamicTest(file.name(),
() -> assertTrue(isValidJson(schemaVersion, file))
));
} else if (file.name().startsWith("invalid") && schemaVersion != null) {
} else if (file.name().startsWith("invalid")) {
dynamicTests.add(
DynamicTest.dynamicTest(file.name(),
() -> assertFalse(isValidJson(schemaVersion, file))
Expand Down

0 comments on commit d08e2e7

Please sign in to comment.