fai-springboot-test — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited fai-springboot-test (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Write unit, integration, and slice tests for Spring Boot applications.
@WebMvcTest(ChatController.class)
class ChatControllerTest {
@Autowired MockMvc mockMvc;
@MockBean ChatService chatService;
@Test
void chat_validInput_returns200() throws Exception {
when(chatService.chat(any())).thenReturn(new ChatResponse("Response", 150));
mockMvc.perform(post("/api/chat")
.contentType(APPLICATION_JSON)
.content("""{"message": "Hello"}"""))
.andExpect(status().isOk())
.andExpect(jsonPath("$.reply").value("Response"))
.andExpect(jsonPath("$.tokens").value(150));
}
@Test
void chat_emptyMessage_returns400() throws Exception {
mockMvc.perform(post("/api/chat")
.contentType(APPLICATION_JSON)
.content("""{"message": ""}"""))
.andExpect(status().isBadRequest());
}
}@DataJpaTest
class ConversationRepositoryTest {
@Autowired ConversationRepository repo;
@Test
void findByUserId_returnsOrdered() {
repo.save(new Conversation("user-1", "First"));
repo.save(new Conversation("user-1", "Second"));
repo.save(new Conversation("user-2", "Other"));
var results = repo.findByUserIdOrderByCreatedAtDesc("user-1");
assertThat(results).hasSize(2);
assertThat(results.get(0).getTitle()).isEqualTo("Second");
}
}@SpringBootTest
@Testcontainers
class ChatIntegrationTest {
@Container
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:16");
@DynamicPropertySource
static void props(DynamicPropertyRegistry registry) {
registry.add("spring.datasource.url", postgres::getJdbcUrl);
registry.add("spring.datasource.username", postgres::getUsername);
registry.add("spring.datasource.password", postgres::getPassword);
}
@Autowired TestRestTemplate restTemplate;
@Test
void fullFlow_createAndRetrieve() {
var resp = restTemplate.postForEntity("/api/chat",
new ChatRequest("Hello"), ChatResponse.class);
assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(resp.getBody().reply()).isNotBlank();
}
}# src/test/resources/application-test.yml
spring:
datasource:
url: jdbc:h2:mem:testdb
jpa:
hibernate.ddl-auto: create-drop| Issue | Cause | Fix |
|---|---|---|
| Full context loads | Using @SpringBootTest for unit test | Use @WebMvcTest or @DataJpaTest |
| Testcontainers slow | Starting per test class | Use @Container + reusable flag |
| Mock not injected | Wrong annotation | Use @MockBean, not @Mock |
| H2 SQL incompatible | PostgreSQL-specific syntax | Use Testcontainers for Postgres |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.