From 811b630b124662fcdec5534790dddb3367a96c57 Mon Sep 17 00:00:00 2001 From: footaku <18702821+footaku@users.noreply.github.com> Date: Mon, 30 Oct 2023 08:56:52 +0900 Subject: [PATCH] Add test for primitive type. --- src/test/java/com/example/footaku/NormalClass.java | 4 ++++ .../erai/ShouldBeIndicateReturnValueNullabilityTest.java | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/example/footaku/NormalClass.java b/src/test/java/com/example/footaku/NormalClass.java index 03af44a..7c4840a 100644 --- a/src/test/java/com/example/footaku/NormalClass.java +++ b/src/test/java/com/example/footaku/NormalClass.java @@ -51,4 +51,8 @@ public String annotatedWithJakartaNullable() { public String annotatedWithSpringNullable() { return "Hello, world"; } + + public int primitiveTypeNeedNotAnnotations() { + return -1; + } } diff --git a/src/test/java/io/github/footaku/erai/ShouldBeIndicateReturnValueNullabilityTest.java b/src/test/java/io/github/footaku/erai/ShouldBeIndicateReturnValueNullabilityTest.java index 05189a2..0258623 100644 --- a/src/test/java/io/github/footaku/erai/ShouldBeIndicateReturnValueNullabilityTest.java +++ b/src/test/java/io/github/footaku/erai/ShouldBeIndicateReturnValueNullabilityTest.java @@ -1,7 +1,7 @@ package io.github.footaku.erai; -import io.github.footaku.erai.rule.ShouldBeIndicateReturnValueNullability; import com.societegenerale.commons.plugin.utils.ArchUtils; +import io.github.footaku.erai.rule.ShouldBeIndicateReturnValueNullability; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,7 +28,6 @@ public void defaultSettingTestShouldThrowViolations() { }); Assertions.assertThat(th).isInstanceOf(AssertionError.class).hasMessageContaining("was violated (2 times)"); - } @Test