[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AKRXKVDX1QQ6STCGD0W56S":3,"skill-same:01M7AKRXKVDX1QQ6STCGD0W56S":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7AKRXKVDX1QQ6STCGD0W56S","quarkus-tdd",null,"Test-driven development for Quarkus 3.x LTS using JUnit 5, Mockito, REST Assured, Camel testing, and JaCoCo. Use when adding features, fixing bugs, or refactoring event-driven services.","Cyrilthetecchieee\u002Fcyril-code-","Cyrilthetecchieee","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F219787998?v=4","01M7AF0MMMKRAA0H61XMJPV92H","Julian Cyril D ","01M7AF0MQ10AVG6QJQ1C2BC0F5",2,"MIT","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fdocs\u002Ftr\u002Fskills\u002Fquarkus-tdd\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: quarkus-tdd\ndescription: Test-driven development for Quarkus 3.x LTS using JUnit 5, Mockito, REST Assured, Camel testing, and JaCoCo. Use when adding features, fixing bugs, or refactoring event-driven services.\norigin: ECC\n---\n\n# Quarkus TDD İş Akışı\n\n80%+ kapsam (unit + integration) ile Quarkus 3.x servisleri için TDD rehberi. Apache Camel ile event-driven mimariler için optimize edilmiştir.\n\n## When to Use\n\n- Yeni özellikler veya REST endpoint'leri\n- Bug düzeltmeleri veya refactoring'ler\n- Veri erişim mantığı, güvenlik kuralları veya reaktif akışlar ekleme\n- Apache Camel route'larını ve event handler'larını test etme\n- RabbitMQ ile event-driven servisleri test etme\n- Koşullu akış mantığını test etme\n- CompletableFuture async işlemlerini doğrulama\n- LogContext yayılımını test etme\n\n## How It Works\n\n1. Önce testleri yazın (başarısız olmalılar)\n2. Geçmek için minimal kod uygulayın\n3. Testleri yeşil tutarken refactor edin\n4. JaCoCo ile kapsamı zorlayın (%80+ hedef)\n\n## Examples\n\n### @Nested Organizasyonlu Unit Testler\n\nKapsamlı ve okunabilir testler için bu yapılandırılmış yaklaşımı izleyin:\n\n```java\n@ExtendWith(MockitoExtension.class)\n@DisplayName(\"As2ProcessingService Unit Tests\")\nclass As2ProcessingServiceTest {\n\n  @Mock\n  private InvoiceFlowValidator invoiceFlowValidator;\n\n  @Mock\n  private EventService eventService;\n\n  @Mock\n  private DocumentJobService documentJobService;\n\n  @Mock\n  private BusinessRulesPublisher businessRulesPublisher;\n\n  @Mock\n  private FileStorageService fileStorageService;\n\n  @InjectMocks\n  private As2ProcessingService as2ProcessingService;\n\n  private Path testFilePath;\n  private LogContext testLogContext;\n  private InvoiceValidationResult validationResult;\n  private StoredDocumentInfo documentInfo;\n\n  @BeforeEach\n  void setUp() {\n    \u002F\u002F ARRANGE - Ortak test verisi\n    testFilePath = Path.of(\"\u002Ftmp\u002Ftest-invoice.xml\");\n\n    testLogContext = new LogContext();\n    testLogContext.put(As2Constants.STRUCTURE_ID, \"STRUCT-001\");\n    testLogContext.put(As2Constants.FILE_NAME, \"invoice.xml\");\n    testLogContext.put(As2Constants.AS2_FROM, \"PARTNER-001\");\n\n    validationResult = new InvoiceValidationResult();\n    validationResult.setValid(true);\n    validationResult.setSize(1024L);\n    validationResult.setDocumentHash(\"abc123\");\n\n    documentInfo = new StoredDocumentInfo();\n    documentInfo.setPath(\"s3:\u002F\u002Fbucket\u002Fpath\u002Finvoice.xml\");\n    documentInfo.setSize(1024L);\n  }\n\n  @Nested\n  @DisplayName(\"processFile için testler\")\n  class ProcessFile {\n\n    @Test\n    @DisplayName(\"CHORUS olmayan dosyayı tüm validasyonlarla başarıyla işlemeli\")\n    void givenNonChorusFile_whenProcessFile_thenAllValidationsApplied() throws Exception {\n      \u002F\u002F ARRANGE\n      testLogContext.put(As2Constants.CHORUS_FLOW, \"false\");\n      CustomLog.setCurrentContext(testLogContext);\n\n      when(invoiceFlowValidator.validateFlowWithConfig(\n          eq(testFilePath),\n          eq(ValidationFlowConfig.allValidations()),\n          eq(EInvoiceSyntaxFormat.UBL),\n          any(LogContext.class)))\n          .thenReturn(validationResult);\n\n      when(invoiceFlowValidator.computeFlowProfile(any(), any()))\n          .thenReturn(FlowProfile.BASIC);\n\n      when(fileStorageService.uploadOriginalFile(any(), anyLong(), any(), any()))\n          .thenReturn(CompletableFuture.completedFuture(documentInfo));\n\n      when(documentJobService.createDocumentAndJobEntities(any(), any(), any(), any(), any()))\n          .thenReturn(new BusinessRulesPayload());\n\n      \u002F\u002F ACT\n      assertDoesNotThrow(() -> as2ProcessingService.processFile(testFilePath));\n\n      \u002F\u002F ASSERT\n      verify(invoiceFlowValidator).validateFlowWithConfig(\n          eq(testFilePath),\n          eq(ValidationFlowConfig.allValidations()),\n          eq(EInvoiceSyntaxFormat.UBL),\n          any(LogContext.class));\n\n      verify(eventService).createSuccessEvent(any(StoredDocumentInfo.class),\n          eq(\"PERSISTENCE_BLOB_EVENT_TYPE\"));\n      verify(eventService).createSuccessEvent(any(BusinessRulesPayload.class),\n          eq(\"BUSINESS_RULES_MESSAGE_SENT\"));\n      verify(businessRulesPublisher).publishAsync(any(BusinessRulesPayload.class));\n    }\n\n    @Test\n    @DisplayName(\"CHORUS_FLOW için schematron validasyonu atlanmalı\")\n    void givenChorusFlow_whenProcessFile_thenSchematronBypassed() throws Exception {\n      \u002F\u002F ARRANGE\n      testLogContext.put(As2Constants.CHORUS_FLOW, \"true\");\n      CustomLog.setCurrentContext(testLogContext);\n\n      when(invoiceFlowValidator.validateFlowWithConfig(\n          eq(testFilePath),\n          eq(ValidationFlowConfig.xsdOnly()),\n          eq(EInvoiceSyntaxFormat.UBL),\n          any(LogContext.class)))\n          .thenReturn(validationResult);\n\n      when(fileStorageService.uploadOriginalFile(any(), anyLong(), any(), any()))\n          .thenReturn(CompletableFuture.completedFuture(documentInfo));\n\n      when(documentJobService.createDocumentAndJobEntities(any(), any(), any(),\n          eq(FlowProfile.EXTENDED_CTC_FR), any()))\n          .thenReturn(new BusinessRulesPayload());\n\n      \u002F\u002F ACT\n      assertDoesNotThrow(() -> as2ProcessingService.processFile(testFilePath));\n\n      \u002F\u002F ASSERT\n      verify(invoiceFlowValidator).validateFlowWithConfig(\n          eq(testFilePath),\n          eq(ValidationFlowConfig.xsdOnly()),\n          eq(EInvoiceSyntaxFormat.UBL),\n          any(LogContext.class));\n\n      verify(documentJobService).createDocumentAndJobEntities(\n          any(), any(), any(),\n          eq(FlowProfile.EXTENDED_CTC_FR),\n          any());\n    }\n\n    @Test\n    @DisplayName(\"Dosya yükleme başarısız olduğunda hata eventi oluşturulmalı\")\n    void givenUploadFailure_whenProcessFile_thenErrorEventCreated() throws Exception {\n      \u002F\u002F ARRANGE\n      testLogContext.put(As2Constants.CHORUS_FLOW, \"false\");\n      CustomLog.setCurrentContext(testLogContext);\n\n      when(invoiceFlowValidator.validateFlowWithConfig(any(), any(), any(), any()))\n          .thenReturn(validationResult);\n\n      when(invoiceFlowValidator.computeFlowProfile(any(), any()))\n          .thenReturn(FlowProfile.BASIC);\n\n      documentInfo.setPath(\"\"); \u002F\u002F Boş path hatayı tetikler\n      when(fileStorageService.uploadOriginalFile(any(), anyLong(), any(), any()))\n          .thenReturn(CompletableFuture.completedFuture(documentInfo));\n\n      \u002F\u002F ACT & ASSERT\n      As2ServerProcessingException exception = assertThrows(\n          As2ServerProcessingException.class,\n          () -> as2ProcessingService.processFile(testFilePath)\n      );\n\n      assertThat(exception.getMessage())\n          .contains(\"File path is empty after upload\");\n\n      verify(eventService).createErrorEvent(\n          eq(documentInfo),\n          eq(\"FILE_UPLOAD_FAILED\"),\n          contains(\"File path is empty\"));\n\n      verify(businessRulesPublisher, never()).publishAsync(any());\n    }\n\n    @Test\n    @DisplayName(\"CompletableFuture.join() başarısızlığı ele alınmalı\")\n    void givenAsyncUploadFailure_whenProcessFile_thenExceptionThrown() throws Exception {\n      \u002F\u002F ARRANGE\n      testLogContext.put(As2Constants.CHORUS_FLOW, \"false\");\n      CustomLog.setCurrentContext(testLogContext);\n\n      when(invoiceFlowValidator.validateFlowWithConfig(any(), any(), any(), any()))\n          .thenReturn(validationResult);\n\n      when(invoiceFlowValidator.computeFlowProfile(any(), any()))\n          .thenReturn(FlowProfile.BASIC);\n\n      CompletableFuture\u003CStoredDocumentInfo> failedFuture =\n          CompletableFuture.failedFuture(new StorageException(\"S3 connection failed\"));\n      when(fileStorageService.uploadOriginalFile(any(), anyLong(), any(), any()))\n          .thenReturn(failedFuture);\n\n      \u002F\u002F ACT & ASSERT\n      assertThrows(\n          CompletionException.class,\n          () -> as2ProcessingService.processFile(testFilePath)\n      );\n    }\n\n    @Test\n    @DisplayName(\"Dosya yolu null olduğunda exception fırlatılmalı\")\n    void givenNullFilePath_whenProcessFile_thenThrowsException() {\n      \u002F\u002F ARRANGE\n      Path nullPath = null;\n\n      \u002F\u002F ACT & ASSERT\n      NullPointerException exception = assertThrows(\n          NullPointerException.class,\n          () -> as2ProcessingService.processFile(nullPath)\n      );\n\n      verify(invoiceFlowValidator, never()).validateFlowWithConfig(any(), any(), any(), any());\n    }\n  }\n}\n```\n\n### Temel Test Desenleri\n\n1. **@Nested Sınıflar**: Testleri test edilen metoda göre gruplandırın\n2. **@DisplayName**: Test raporlarında okunabilir açıklamalar sağlayın\n3. **İsimlendirme Kuralı**: Netlik için `givenX_whenY_thenZ`\n4. **AAA Deseni**: Açık `\u002F\u002F ARRANGE`, `\u002F\u002F ACT`, `\u002F\u002F ASSERT` yorumları\n5. **@BeforeEach**: Tekrarı azaltmak için ortak test verisi kurulumu\n6. **assertDoesNotThrow**: Exception yakalamadan başarı senaryolarını test edin\n7. **assertThrows**: AssertJ kullanarak mesaj doğrulamalı exception senaryolarını test edin\n8. **Kapsamlı Kapsam**: Mutlu yolları, null girdileri, edge case'leri, exception'ları test edin\n9. **Etkileşimleri Doğrulama**: Metodların doğru çağrıldığından emin olmak için Mockito `verify()` kullanın\n10. **Hiçbir Zaman Doğrulama**: Hata senaryolarında metodların ÇAĞRILMADIĞINI sağlamak için `never()` kullanın\n\n## Camel Route Testi\n\n```java\n@QuarkusTest\n@DisplayName(\"Business Rules Camel Route Tests\")\nclass BusinessRulesRouteTest {\n\n  @Inject\n  CamelContext camelContext;\n\n  @Inject\n  ProducerTemplate producerTemplate;\n\n  @InjectMock\n  EventService eventService;\n\n  private BusinessRulesPayload testPayload;\n\n  @BeforeEach\n  void setUp() {\n    \u002F\u002F ARRANGE - Test verisi\n    testPayload = new BusinessRulesPayload();\n    testPayload.setDocumentId(1L);\n    testPayload.setFlowProfile(FlowProfile.BASIC);\n  }\n\n  @Nested\n  @DisplayName(\"business-rules-publisher route için testler\")\n  class BusinessRulesPublisher {\n\n    @Test\n    @DisplayName(\"Mesajı başarıyla RabbitMQ'ya yayınlamalı\")\n    void givenValidPayload_whenPublish_thenMessageSentToQueue() throws Exception {\n      \u002F\u002F ARRANGE\n      MockEndpoint mockRabbitMQ = camelContext.getEndpoint(\"mock:rabbitmq\", MockEndpoint.class);\n      mockRabbitMQ.expectedMessageCount(1);\n\n      \u002F\u002F Test için gerçek endpoint'i mock ile değiştir\n      camelContext.getRouteController().stopRoute(\"business-rules-publisher\");\n      AdviceWith.adviceWith(camelContext, \"business-rules-publisher\", advice -> {\n        advice.replaceFromWith(\"direct:business-rules-publisher\");\n        advice.weaveByToString(\".*spring-rabbitmq.*\").replace().to(\"mock:rabbitmq\");\n      });\n      camelContext.getRouteController().startRoute(\"business-rules-publisher\");\n\n      \u002F\u002F ACT\n      producerTemplate.sendBody(\"direct:business-rules-publisher\", testPayload);\n\n      \u002F\u002F ASSERT — .marshal().json() sonrası body JSON String'dir\n      mockRabbitMQ.assertIsSatisfied(5000);\n\n      assertThat(mockRabbitMQ.getExchanges()).hasSize(1);\n      String body = mockRabbitMQ.getExchanges().get(0).getIn().getBody(String.class);\n      assertThat(body).contains(\"\\\"documentId\\\":1\");\n    }\n\n    @Test\n    @DisplayName(\"JSON'a marshalling'i ele almalı\")\n    void givenPayload_whenPublish_thenMarshalledToJson() throws Exception {\n      \u002F\u002F ARRANGE\n      MockEndpoint mockMarshal = new MockEndpoint(\"mock:marshal\");\n      camelContext.addEndpoint(\"mock:marshal\", mockMarshal);\n      mockMarshal.expectedMessageCount(1);\n\n      camelContext.getRouteController().stopRoute(\"business-rules-publisher\");\n      AdviceWith.adviceWith(camelContext, \"business-rules-publisher\", advice -> {\n        advice.weaveAddLast().to(\"mock:marshal\");\n      });\n      camelContext.getRouteController().startRoute(\"business-rules-publisher\");\n\n      \u002F\u002F ACT\n      producerTemplate.sendBody(\"direct:business-rules-publisher\", testPayload);\n\n      \u002F\u002F ASSERT\n      mockMarshal.assertIsSatisfied(5000);\n\n      String body = mockMarshal.getExchanges().get(0).getIn().getBody(String.class);\n      assertThat(body).contains(\"\\\"documentId\\\":1\");\n      assertThat(body).contains(\"\\\"flowProfile\\\":\\\"BASIC\\\"\");\n    }\n  }\n\n  @Nested\n  @DisplayName(\"document-processing route için testler\")\n  class DocumentProcessing {\n\n    @Test\n    @DisplayName(\"Faturayı doğru işlemciye yönlendirmeli\")\n    void givenInvoiceType_whenProcess_thenRoutesToInvoiceProcessor() throws Exception {\n      \u002F\u002F ARRANGE\n      MockEndpoint mockInvoice = camelContext.getEndpoint(\"mock:invoice\", MockEndpoint.class);\n      mockInvoice.expectedMessageCount(1);\n\n      camelContext.getRouteController().stopRoute(\"document-processing\");\n      AdviceWith.adviceWith(camelContext, \"document-processing\", advice -> {\n        advice.weaveByToString(\".*direct:process-invoice.*\").replace().to(\"mock:invoice\");\n      });\n      camelContext.getRouteController().startRoute(\"document-processing\");\n\n      \u002F\u002F ACT\n      producerTemplate.sendBodyAndHeader(\"direct:process-document\",\n          testPayload, \"documentType\", \"INVOICE\");\n\n      \u002F\u002F ASSERT\n      mockInvoice.assertIsSatisfied(5000);\n    }\n\n    @Test\n    @DisplayName(\"Validasyon hatalarını zarif şekilde ele almalı\")\n    void givenValidationError_whenProcess_thenRoutesToErrorHandler() throws Exception {\n      \u002F\u002F ARRANGE\n      MockEndpoint mockError = camelContext.getEndpoint(\"mock:error\", MockEndpoint.class);\n      mockError.expectedMessageCount(1);\n\n      camelContext.getRouteController().stopRoute(\"document-processing\");\n      AdviceWith.adviceWith(camelContext, \"document-processing\", advice -> {\n        advice.weaveByToString(\".*direct:validation-error-handler.*\")\n            .replace().to(\"mock:error\");\n      });\n      camelContext.getRouteController().startRoute(\"document-processing\");\n\n      \u002F\u002F Error event oluşturma hatasını gerçek EventService API'si üzerinden simüle et\n      doThrow(new ValidationException(\"Invalid document\"))\n          .when(eventService)\n          .createErrorEvent(any(), eq(\"VALIDATION_ERROR\"), anyString());\n\n      \u002F\u002F ACT\n      producerTemplate.sendBody(\"direct:process-document\", testPayload);\n\n      \u002F\u002F ASSERT\n      mockError.assertIsSatisfied(5000);\n\n      Exception exception = mockError.getExchanges().get(0).getException();\n      assertThat(exception).isInstanceOf(ValidationException.class);\n      assertThat(exception.getMessage()).contains(\"Invalid document\");\n    }\n  }\n}\n```\n\n## Event Service Testi\n\n```java\n@ExtendWith(MockitoExtension.class)\n@DisplayName(\"EventService Unit Tests\")\nclass EventServiceTest {\n\n  @Mock\n  private EventRepository eventRepository;\n\n  @Mock\n  private ObjectMapper objectMapper;\n\n  @InjectMocks\n  private EventService eventService;\n\n  private BusinessRulesPayload testPayload;\n\n  @BeforeEach\n  void setUp() {\n    \u002F\u002F ARRANGE\n    testPayload = new BusinessRulesPayload();\n    testPayload.setDocumentId(1L);\n  }\n\n  @Nested\n  @DisplayName(\"createSuccessEvent için testler\")\n  class CreateSuccessEvent {\n\n    @Test\n    @DisplayName(\"Doğru niteliklerle başarı eventi oluşturulmalı\")\n    void givenValidPayload_whenCreateSuccessEvent_thenEventPersisted() throws Exception {\n      \u002F\u002F ARRANGE\n      when(objectMapper.writeValueAsString(testPayload)).thenReturn(\"{\\\"documentId\\\":1}\");\n\n      \u002F\u002F ACT\n      assertDoesNotThrow(() ->\n          eventService.createSuccessEvent(testPayload, \"DOCUMENT_PROCESSED\"));\n\n      \u002F\u002F ASSERT\n      verify(eventRepository).persist(argThat(event ->\n          event.getType().equals(\"DOCUMENT_PROCESSED\") &&\n          event.getStatus() == EventStatus.SUCCESS &&\n          event.getPayload().equals(\"{\\\"documentId\\\":1}\") &&\n          event.getTimestamp() != null\n      ));\n    }\n\n    @Test\n    @DisplayName(\"Payload null olduğunda exception fırlatılmalı\")\n    void givenNullPayload_whenCreateSuccessEvent_thenThrowsException() {\n      \u002F\u002F ARRANGE\n      Object nullPayload = null;\n\n      \u002F\u002F ACT & ASSERT\n      NullPointerException exception = assertThrows(\n          NullPointerException.class,\n          () -> eventService.createSuccessEvent(nullPayload, \"EVENT_TYPE\")\n      );\n\n      assertThat(exception.getMessage()).isEqualTo(\"Payload cannot be null\");\n      verify(eventRepository, never()).persist(any());\n    }\n  }\n\n  @Nested\n  @DisplayName(\"createErrorEvent için testler\")\n  class CreateErrorEvent {\n\n    @Test\n    @DisplayName(\"Hata mesajıyla hata eventi oluşturulmalı\")\n    void givenError_whenCreateErrorEvent_thenEventPersistedWithMessage() throws Exception {\n      \u002F\u002F ARRANGE\n      String errorMessage = \"Processing failed\";\n      when(objectMapper.writeValueAsString(testPayload)).thenReturn(\"{\\\"documentId\\\":1}\");\n\n      \u002F\u002F ACT\n      assertDoesNotThrow(() ->\n          eventService.createErrorEvent(testPayload, \"PROCESSING_ERROR\", errorMessage));\n\n      \u002F\u002F ASSERT\n      verify(eventRepository).persist(argThat(event ->\n          event.getType().equals(\"PROCESSING_ERROR\") &&\n          event.getStatus() == EventStatus.ERROR &&\n          event.getErrorMessage().equals(errorMessage) &&\n          event.getPayload().equals(\"{\\\"documentId\\\":1}\")\n      ));\n    }\n\n    @ParameterizedTest\n    @DisplayName(\"Geçersiz hata mesajları reddedilmeli\")\n    @ValueSource(strings = {\"\", \" \"})\n    void givenBlankErrorMessage_whenCreateErrorEvent_thenThrowsException(String blankMessage) {\n      \u002F\u002F ACT & ASSERT\n      IllegalArgumentException exception = assertThrows(\n          IllegalArgumentException.class,\n          () -> eventService.createErrorEvent(testPayload, \"ERROR\", blankMessage)\n      );\n\n      assertThat(exception.getMessage()).contains(\"Error message cannot be blank\");\n    }\n  }\n}\n```\n\n## CompletableFuture Testi\n\n```java\n@ExtendWith(MockitoExtension.class)\n@DisplayName(\"FileStorageService Unit Tests\")\nclass FileStorageServiceTest {\n\n  @Mock\n  private S3Client s3Client;\n\n  @Mock\n  private ExecutorService executorService;\n\n  @InjectMocks\n  private FileStorageService fileStorageService;\n\n  private InputStream testInputStream;\n  private LogContext testLogContext;\n\n  @BeforeEach\n  void setUp() {\n    \u002F\u002F ARRANGE\n    testInputStream = new ByteArrayInputStream(\"test content\".getBytes());\n    testLogContext = new LogContext();\n    testLogContext.put(\"traceId\", \"trace-123\");\n  }\n\n  @Nested\n  @DisplayName(\"uploadOriginalFile için testler\")\n  class UploadOriginalFile {\n\n    @Test\n    @DisplayName(\"Dosyayı başarıyla yüklemeli ve belge bilgisi döndürmeli\")\n    void givenValidFile_whenUpload_thenReturnsDocumentInfo() throws Exception {\n      \u002F\u002F ARRANGE\n      doAnswer(invocation -> {\n        ((Runnable) invocation.getArgument(0)).run();\n        return null;\n      }).when(executorService).execute(any(Runnable.class));\n\n      when(s3Client.putObject(any(PutObjectRequest.class), any(RequestBody.class)))\n          .thenReturn(PutObjectResponse.builder().build());\n\n      \u002F\u002F ACT\n      CompletableFuture\u003CStoredDocumentInfo> future =\n          fileStorageService.uploadOriginalFile(testInputStream, 1024L,\n              testLogContext, InvoiceFormat.UBL);\n\n      StoredDocumentInfo result = future.join();\n\n      \u002F\u002F ASSERT\n      assertThat(result).isNotNull();\n      assertThat(result.getPath()).isNotBlank();\n      assertThat(result.getSize()).isEqualTo(1024L);\n      assertThat(result.getUploadedAt()).isNotNull();\n\n      verify(s3Client).putObject(any(PutObjectRequest.class), any(RequestBody.class));\n    }\n\n    @Test\n    @DisplayName(\"S3 yükleme başarısızlığını ele almalı\")\n    void givenS3Failure_whenUpload_thenCompletableFutureFails() {\n      \u002F\u002F ARRANGE\n      doAnswer(invocation -> {\n        ((Runnable) invocation.getArgument(0)).run();\n        return null;\n      }).when(executorService).execute(any(Runnable.class));\n\n      when(s3Client.putObject(any(PutObjectRequest.class), any(RequestBody.class)))\n          .thenThrow(new StorageException(\"S3 unavailable\"));\n\n      \u002F\u002F ACT\n      CompletableFuture\u003CStoredDocumentInfo> future =\n          fileStorageService.uploadOriginalFile(testInputStream, 1024L,\n              testLogContext, InvoiceFormat.UBL);\n\n      \u002F\u002F ASSERT\n      assertThatThrownBy(() -> future.join())\n          .isInstanceOf(CompletionException.class)\n          .hasCauseInstanceOf(StorageException.class)\n          .hasMessageContaining(\"S3 unavailable\");\n    }\n\n    @Test\n    @DisplayName(\"LogContext'i async işleme yaymalı\")\n    void givenLogContext_whenUpload_thenContextPropagated() throws Exception {\n      \u002F\u002F ARRANGE\n      AtomicReference\u003CLogContext> capturedContext = new AtomicReference\u003C>();\n\n      doAnswer(invocation -> {\n        capturedContext.set(CustomLog.getCurrentContext());\n        ((Runnable) invocation.getArgument(0)).run();\n        return null;\n      }).when(executorService).execute(any(Runnable.class));\n\n      \u002F\u002F ACT\n      fileStorageService.uploadOriginalFile(testInputStream, 1024L,\n          testLogContext, InvoiceFormat.UBL).join();\n\n      \u002F\u002F ASSERT\n      assertThat(capturedContext.get()).isNotNull();\n      assertThat(capturedContext.get().get(\"traceId\")).isEqualTo(\"trace-123\");\n    }\n  }\n}\n```\n\n## Resource Katmanı Testleri (REST Assured)\n\n```java\n@QuarkusTest\n@DisplayName(\"DocumentResource API Tests\")\nclass DocumentResourceTest {\n\n  @InjectMock\n  DocumentService documentService;\n\n  @Nested\n  @DisplayName(\"GET \u002Fapi\u002Fdocuments için testler\")\n  class ListDocuments {\n\n    @Test\n    @DisplayName(\"Belge listesini döndürmeli\")\n    void givenDocumentsExist_whenList_thenReturnsOk() {\n      \u002F\u002F ARRANGE\n      List\u003CDocument> documents = List.of(createDocument(1L, \"DOC-001\"));\n      when(documentService.list(0, 20)).thenReturn(documents);\n\n      \u002F\u002F ACT & ASSERT\n      given()\n          .when().get(\"\u002Fapi\u002Fdocuments\")\n          .then()\n          .statusCode(200)\n          .body(\"$.size()\", is(1))\n          .body(\"[0].referenceNumber\", equalTo(\"DOC-001\"));\n    }\n  }\n\n  @Nested\n  @DisplayName(\"POST \u002Fapi\u002Fdocuments için testler\")\n  class CreateDocument {\n\n    @Test\n    @DisplayName(\"Belge oluşturmalı ve 201 döndürmeli\")\n    void givenValidRequest_whenCreate_thenReturns201() {\n      \u002F\u002F ARRANGE\n      Document document = createDocument(1L, \"DOC-001\");\n      when(documentService.create(any())).thenReturn(document);\n\n      \u002F\u002F ACT & ASSERT\n      given()\n          .contentType(ContentType.JSON)\n          .body(\"\"\"\n              {\n                \"referenceNumber\": \"DOC-001\",\n                \"description\": \"Test document\",\n                \"validUntil\": \"2030-01-01T00:00:00Z\",\n                \"categories\": [\"test\"]\n              }\n              \"\"\")\n          .when().post(\"\u002Fapi\u002Fdocuments\")\n          .then()\n          .statusCode(201)\n          .header(\"Location\", containsString(\"\u002Fapi\u002Fdocuments\u002F1\"))\n          .body(\"referenceNumber\", equalTo(\"DOC-001\"));\n    }\n\n    @Test\n    @DisplayName(\"Geçersiz girdi için 400 döndürmeli\")\n    void givenInvalidRequest_whenCreate_thenReturns400() {\n      \u002F\u002F ACT & ASSERT\n      given()\n          .contentType(ContentType.JSON)\n          .body(\"\"\"\n              {\n                \"referenceNumber\": \"\",\n                \"description\": \"Test\"\n              }\n              \"\"\")\n          .when().post(\"\u002Fapi\u002Fdocuments\")\n          .then()\n          .statusCode(400);\n    }\n  }\n\n  private Document createDocument(Long id, String referenceNumber) {\n    Document document = new Document();\n    document.setId(id);\n    document.setReferenceNumber(referenceNumber);\n    document.setStatus(DocumentStatus.PENDING);\n    return document;\n  }\n}\n```\n\n## Gerçek Veritabanıyla Entegrasyon Testleri\n\n```java\n@QuarkusTest\n@TestProfile(IntegrationTestProfile.class)\n@DisplayName(\"Document Integration Tests\")\nclass DocumentIntegrationTest {\n\n  @Test\n  @Transactional\n  @DisplayName(\"Belge oluşturulmalı ve API üzerinden alınabilmeli\")\n  void givenNewDocument_whenCreateAndRetrieve_thenSuccessful() {\n    \u002F\u002F ACT - API üzerinden oluştur\n    Long id = given()\n        .contentType(ContentType.JSON)\n        .body(\"\"\"\n            {\n              \"referenceNumber\": \"INT-001\",\n              \"description\": \"Integration test\",\n              \"validUntil\": \"2030-01-01T00:00:00Z\",\n              \"categories\": [\"test\"]\n            }\n            \"\"\")\n        .when().post(\"\u002Fapi\u002Fdocuments\")\n        .then()\n        .statusCode(201)\n        .extract().path(\"id\");\n\n    \u002F\u002F ASSERT - API üzerinden al\n    given()\n        .when().get(\"\u002Fapi\u002Fdocuments\u002F\" + id)\n        .then()\n        .statusCode(200)\n        .body(\"referenceNumber\", equalTo(\"INT-001\"));\n  }\n}\n```\n\n## JaCoCo ile Kapsam\n\n### Maven Yapılandırması (Tam)\n\n```xml\n\u003Cplugin>\n  \u003CgroupId>org.jacoco\u003C\u002FgroupId>\n  \u003CartifactId>jacoco-maven-plugin\u003C\u002FartifactId>\n  \u003Cversion>0.8.13\u003C\u002Fversion>\n  \u003Cexecutions>\n    \u003C!-- Test yürütmesi için agent'ı hazırla -->\n    \u003Cexecution>\n      \u003Cid>prepare-agent\u003C\u002Fid>\n      \u003Cgoals>\n        \u003Cgoal>prepare-agent\u003C\u002Fgoal>\n      \u003C\u002Fgoals>\n    \u003C\u002Fexecution>\n\n    \u003C!-- Kapsam raporu oluştur -->\n    \u003Cexecution>\n      \u003Cid>report\u003C\u002Fid>\n      \u003Cphase>verify\u003C\u002Fphase>\n      \u003Cgoals>\n        \u003Cgoal>report\u003C\u002Fgoal>\n      \u003C\u002Fgoals>\n    \u003C\u002Fexecution>\n\n    \u003C!-- Kapsam eşiklerini zorla -->\n    \u003Cexecution>\n      \u003Cid>check\u003C\u002Fid>\n      \u003Cgoals>\n        \u003Cgoal>check\u003C\u002Fgoal>\n      \u003C\u002Fgoals>\n      \u003Cconfiguration>\n        \u003Crules>\n          \u003Crule>\n            \u003Celement>BUNDLE\u003C\u002Felement>\n            \u003Climits>\n              \u003Climit>\n                \u003Ccounter>LINE\u003C\u002Fcounter>\n                \u003Cvalue>COVEREDRATIO\u003C\u002Fvalue>\n                \u003Cminimum>0.80\u003C\u002Fminimum>\n              \u003C\u002Flimit>\n              \u003Climit>\n                \u003Ccounter>BRANCH\u003C\u002Fcounter>\n                \u003Cvalue>COVEREDRATIO\u003C\u002Fvalue>\n                \u003Cminimum>0.70\u003C\u002Fminimum>\n              \u003C\u002Flimit>\n            \u003C\u002Flimits>\n          \u003C\u002Frule>\n        \u003C\u002Frules>\n      \u003C\u002Fconfiguration>\n    \u003C\u002Fexecution>\n  \u003C\u002Fexecutions>\n\u003C\u002Fplugin>\n```\n\nKapsam ile testleri çalıştırın:\n```bash\nmvn clean test\nmvn jacoco:report\nmvn jacoco:check\n\n# Rapor: target\u002Fsite\u002Fjacoco\u002Findex.html\n```\n\n## Test Bağımlılıkları\n\n```xml\n\u003Cdependencies>\n    \u003C!-- Quarkus Test -->\n    \u003Cdependency>\n        \u003CgroupId>io.quarkus\u003C\u002FgroupId>\n        \u003CartifactId>quarkus-junit5\u003C\u002FartifactId>\n        \u003Cscope>test\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n    \u003Cdependency>\n        \u003CgroupId>io.quarkus\u003C\u002FgroupId>\n        \u003CartifactId>quarkus-junit5-mockito\u003C\u002FartifactId>\n        \u003Cscope>test\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n\n    \u003C!-- Mockito -->\n    \u003Cdependency>\n        \u003CgroupId>org.mockito\u003C\u002FgroupId>\n        \u003CartifactId>mockito-core\u003C\u002FartifactId>\n        \u003Cscope>test\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n\n    \u003C!-- AssertJ (JUnit assertion'larına tercih edilir) -->\n    \u003Cdependency>\n        \u003CgroupId>org.assertj\u003C\u002FgroupId>\n        \u003CartifactId>assertj-core\u003C\u002FartifactId>\n        \u003Cversion>3.24.2\u003C\u002Fversion>\n        \u003Cscope>test\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n\n    \u003C!-- REST Assured -->\n    \u003Cdependency>\n        \u003CgroupId>io.rest-assured\u003C\u002FgroupId>\n        \u003CartifactId>rest-assured\u003C\u002FartifactId>\n        \u003Cscope>test\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n\n    \u003C!-- Camel Test -->\n    \u003Cdependency>\n        \u003CgroupId>org.apache.camel.quarkus\u003C\u002FgroupId>\n        \u003CartifactId>camel-quarkus-junit5\u003C\u002FartifactId>\n        \u003Cscope>test\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n\u003C\u002Fdependencies>\n```\n\n## En İyi Uygulamalar\n\n### Test Organizasyonu\n- Testleri test edilen metoda göre gruplandırmak için `@Nested` sınıflar kullanın\n- Raporlarda görünür okunabilir açıklamalar için `@DisplayName` kullanın\n- Test metodları için `givenX_whenY_thenZ` isimlendirme kuralını izleyin\n- Tekrarı azaltmak için ortak test verisi kurulumunda `@BeforeEach` kullanın\n\n### Test Yapısı\n- Açık yorumlarla AAA desenini izleyin (`\u002F\u002F ARRANGE`, `\u002F\u002F ACT`, `\u002F\u002F ASSERT`)\n- Başarı senaryoları için `assertDoesNotThrow` kullanın\n- Mesaj doğrulamalı exception senaryoları için `assertThrows` kullanın\n- AssertJ `contains()` veya `isEqualTo()` kullanarak exception mesajlarının beklenen değerlerle eşleştiğini doğrulayın\n\n### Test Kapsamı\n- Tüm public metodlar için mutlu yolları test edin\n- Null girdi işlemeyi test edin\n- Edge case'leri test edin (boş koleksiyonlar, sınır değerleri, negatif ID'ler, boş string'ler)\n- Exception senaryolarını kapsamlı biçimde test edin\n- Tüm harici bağımlılıkları mock'layın (repository'ler, servisler, Camel endpoint'leri)\n- %80+ satır kapsamı, %70+ branch kapsamı hedefleyin\n\n### Assertion'lar\n- Değer kontrolleri için JUnit assertion'ları yerine **AssertJ'yi tercih edin** (`assertThat`)\n- Okunabilirlik için akıcı AssertJ API'si kullanın: `assertThat(list).hasSize(3).contains(item)`\n- Exception'lar için: JUnit `assertThrows` ile yakalayın, ardından AssertJ ile mesajı doğrulayın\n- Fırlatılmayan başarı yolları için: JUnit `assertDoesNotThrow` kullanın\n- Koleksiyonlar için: `extracting()`, `filteredOn()`, `containsExactly()`\n\n### Entegrasyon Testi\n- Entegrasyon testleri için `@QuarkusTest` kullanın\n- Quarkus testlerinde bağımlılıkları mock'lamak için `@InjectMock` kullanın\n- API testi için REST Assured'ı tercih edin\n- Test'e özel yapılandırma için `@TestProfile` kullanın\n\n### Event-Driven Test\n- `AdviceWith` ve `MockEndpoint` ile Camel route'larını test edin\n- `@CamelQuarkusTest` annotasyonu kullanın (bağımsız Camel testleri kullanıyorsanız)\n- Mesaj içeriğini, başlıklarını ve yönlendirme mantığını doğrulayın\n- Hata işleme route'larını ayrı ayrı test edin\n- Unit testlerde harici sistemleri (RabbitMQ, S3, veritabanları) mock'layın\n\n### Camel Route Testi\n- Mesaj akışını doğrulamak için `MockEndpoint` kullanın\n- Test için route'ları değiştirmek üzere `AdviceWith` kullanın (endpoint'leri mock'larla değiştirin)\n- Mesaj dönüşümünü ve marshalling'i test edin\n- Exception işleme ve dead letter queue'ları test edin\n\n### Async İşlem Testi\n- CompletableFuture başarı ve başarısızlık senaryolarını test edin\n- Async tamamlanmayı beklemek için testlerde `.join()` kullanın\n- CompletableFuture'dan exception yayılımını test edin\n- LogContext yayılımını async işlemlere doğrulayın\n\n### Performans\n- Testleri hızlı ve izole tutun\n- Testleri sürekli modda çalıştırın: `mvn quarkus:test`\n- Girdi varyasyonları için parametreli testler (`@ParameterizedTest`) kullanın\n- Yeniden kullanılabilir test verisi builder'ları veya factory metodları oluşturun\n\n### Quarkus'a Özgü\n- En son LTS sürümünde kalın (Quarkus 3.x)\n- Native derleme uyumluluğunu periyodik olarak test edin\n- Farklı senaryolar için Quarkus test profillerini kullanın\n- Yerel test için Quarkus dev servislerinden yararlanın\n- `@MockBean` yerine `@InjectMock` kullanın (Quarkus'a özgü)\n\n### Doğrulama En İyi Uygulamaları\n- Mock'lanmış bağımlılıklardaki etkileşimleri her zaman doğrulayın\n- Hata senaryolarında metodların ÇAĞRILMADIĞINI sağlamak için `verify(mock, never())` kullanın\n- Karmaşık argüman eşleştirme için `argThat()` kullanın\n- Önem taşıdığında çağrı sırasını doğrulayın: Mockito'dan `InOrder`\n","# Quarkus TDD İş Akışı\n\n80%+ kapsam (unit + integration) ile Quarkus 3.x servisleri için TDD rehberi. Apache Camel ile event-driven mimariler için optimize edilmiştir.\n\n## When to Use\n\n- Yeni özellikler veya REST endpoint'leri\n- Bug düzeltmeleri veya refactoring'ler\n- Veri erişim mantığı, güvenlik kuralları veya reaktif akışlar ekleme\n- Apache Camel route'larını ve event handler'larını test etme\n- RabbitMQ ile event-driven servisleri test etme\n- Koşullu akış mantığını test etme\n- CompletableFuture async işlemlerini doğrulama\n- LogContext yayılımını test etme\n\n## How It Works\n\n1. Önce testleri yazın (başarısız olmalılar)\n2. Geçmek için minimal kod uygulayın\n3. Testleri yeşil tutarken refactor edin\n4. JaCoCo ile kapsamı zorlayın (%80+ hedef)\n\n## Examples\n\n### @Nested Organizasyonlu Unit Testler\n\nKapsamlı ve okunabilir testler için bu yapılandırılmış yaklaşımı izleyin:\n\n```java\n@ExtendWith(MockitoExtension.class)\n@DisplayName(\"As2ProcessingService Unit Tests\")\nclass As2ProcessingServiceTest {\n\n  @Mock\n  private InvoiceFlowValidator invoiceFlowValidator;\n\n  @Mock\n  private EventService eventService;\n\n  @Mock\n  private DocumentJobService documentJobService;\n\n  @Mock\n  private BusinessRulesPublisher businessRulesPublisher;\n\n  @Mock\n  private FileStorageService fileStorageService;\n\n  @InjectMocks\n  private As2ProcessingService as2ProcessingService;\n\n  private Path testFilePath;\n  private LogContext testLogContext;\n  private InvoiceValidationResult validationResult;\n  private StoredDocumentInfo documentInfo;\n\n  @BeforeEach\n  void setUp() {\n    \u002F\u002F ARRANGE - Ortak test verisi\n    testFilePath = Path.of(\"\u002Ftmp\u002Ftest-invoice.xml\");\n\n    testLogContext = new LogContext();\n    testLogContext.put(As2Constants.STRUCTURE_ID, \"STRUCT-001\");\n    testLogContext.put(As2Constants.FILE_NAME, \"invoice.xml\");\n    testLogContext.put(As2Constants.AS2_FROM, \"PARTNER-001\");\n\n    validationResult = new InvoiceValidationResult();\n    validationResult.setValid(true);\n    validationResult.setSize(1024L);\n    validationResult.setDocumentHash(\"abc123\");\n\n    documentInfo = new StoredDocumentInfo();\n    documentInfo.setPath(\"s3:\u002F\u002Fbucket\u002Fpath\u002Finvoice.xml\");\n    documentInfo.setSize(1024L);\n  }\n\n  @Nested\n  @DisplayName(\"processFile için testler\")\n  class ProcessFile {\n\n    @Test\n    @DisplayName(\"CHORUS olmayan dosyayı tüm validasyonlarla başarıyla işlemeli\")\n    void givenNonChorusFile_whenProcessFile_thenAllValidationsApplied() throws Exception {\n      \u002F\u002F ARRANGE\n      testLogContext.put(As2Constants.CHORUS_FLOW, \"false\");\n      CustomLog.setCurrentContext(testLogContext);\n\n      when(invoiceFlowValidator.validateFlowWithConfig(\n          eq(testFilePath),\n          eq(ValidationFlowConfig.allValidations()),\n          eq(EInvoiceSyntaxFormat.UBL),\n          any(LogContext.class)))\n          .thenReturn(validationResult);\n\n      when(invoiceFlowValidator.computeFlowProfile(any(), any()))\n          .thenReturn(FlowProfile.BASIC);\n\n      when(fileStorageService.uploadOriginalFile(any(), anyLong(), any(), any()))\n          .thenReturn(CompletableFuture.completedFuture(documentInfo));\n\n      when(documentJobService.createDocumentAndJobEntities(any(), any(), any(), any(), any()))\n          .thenReturn(new BusinessRulesPayload());\n\n      \u002F\u002F ACT\n      assertDoesNotThrow(() -> as2ProcessingService.processFile(testFilePath));\n\n      \u002F\u002F ASSERT\n      verify(invoiceFlowValidator).validateFlowWithConfig(\n          eq(testFilePath),\n          eq(ValidationFlowConfig.allValidations()),\n          eq(EInvoiceSyntaxFormat.UBL),\n          any(LogContext.class));\n\n      verify(eventService).createSuccessEvent(any(StoredDocumentInfo.class),\n          eq(\"PERSISTENCE_BLOB_EVENT_TYPE\"));\n      verify(eventService).createSuccessEvent(any(BusinessRulesPayload.class),\n          eq(\"BUSINESS_RULES_MESSAGE_SENT\"));\n      verify(businessRulesPublisher).publishAsync(any(BusinessRulesPayload.class));\n    }\n\n    @Test\n    @DisplayName(\"CHORUS_FLOW için schematron validasyonu atlanmalı\")\n    void givenChorusFlow_whenProcessFile_thenSchematronBypassed() throws Exception {\n      \u002F\u002F ARRANGE\n      testLogContext.put(As2Constants.CHORUS_FLOW, \"true\");\n      CustomLog.setCurrentContext(testLogContext);\n\n      when(invoiceFlowValidator.validateFlowWithConfig(\n          eq(testFilePath),\n          eq(ValidationFlowConfig.xsdOnly()),\n          eq(EInvoiceSyntaxFormat.UBL),\n          any(LogContext.class)))\n          .thenReturn(validationResult);\n\n      when(fileStorageService.uploadOriginalFile(any(), anyLong(), any(), any()))\n          .thenReturn(CompletableFuture.completedFuture(documentInfo));\n\n      when(documentJobService.createDocumentAndJobEntities(any(), any(), any(),\n          eq(FlowProfile.EXTENDED_CTC_FR), any()))\n          .thenReturn(new BusinessRulesPayload());\n\n      \u002F\u002F ACT\n      assertDoesNotThrow(() -> as2ProcessingService.processFile(testFilePath));\n\n      \u002F\u002F ASSERT\n      verify(invoiceFlowValidator).validateFlowWithConfig(\n          eq(testFilePath),\n          eq(ValidationFlowConfig.xsdOnly()),\n          eq(EInvoiceSyntaxFormat.UBL),\n          any(LogContext.class));\n\n      verify(documentJobService).createDocumentAndJobEntities(\n          any(), any(), any(),\n          eq(FlowProfile.EXTENDED_CTC_FR),\n          any());\n    }\n\n    @Test\n    @DisplayName(\"Dosya yükleme başarısız olduğunda hata eventi oluşturulmalı\")\n    void givenUploadFailure_whenProcessFile_thenErrorEventCreated() throws Exception {\n      \u002F\u002F ARRANGE\n      testLogContext.put(As2Constants.CHORUS_FLOW, \"false\");\n      CustomLog.setCurrentContext(testLogContext);\n\n      when(invoiceFlowValidator.validateFlowWithConfig(any(), any(), any(), any()))\n          .thenReturn(validationResult);\n\n      when(invoiceFlowValidator.computeFlowProfile(any(), any()))\n          .thenReturn(FlowProfile.BASIC);\n\n      documentInfo.setPath(\"\"); \u002F\u002F Boş path hatayı tetikler\n      when(fileStorageService.uploadOriginalFile(any(), anyLong(), any(), any()))\n          .thenReturn(CompletableFuture.completedFuture(documentInfo));\n\n      \u002F\u002F ACT & ASSERT\n      As2ServerProcessingException exception = assertThrows(\n          As2ServerProcessingException.class,\n          () -> as2ProcessingService.processFile(testFilePath)\n      );\n\n      assertThat(exception.getMessage())\n          .contains(\"File path is empty after upload\");\n\n      verify(eventService).createErrorEvent(\n          eq(documentInfo),\n          eq(\"FILE_UPLOAD_FAILED\"),\n          contains(\"File path is empty\"));\n\n      verify(businessRulesPublisher, never()).publishAsync(any());\n    }\n\n    @Test\n    @DisplayName(\"CompletableFuture.join() başarısızlığı ele alınmalı\")\n    void givenAsyncUploadFailure_whenProcessFile_thenExceptionThrown() throws Exception {\n      \u002F\u002F ARRANGE\n      testLogContext.put(As2Constants.CHORUS_FLOW, \"false\");\n      CustomLog.setCurrentContext(testLogContext);\n\n      when(invoiceFlowValidator.validateFlowWithConfig(any(), any(), any(), any()))\n          .thenReturn(validationResult);\n\n      when(invoiceFlowValidator.computeFlowProfile(any(), any()))\n          .thenReturn(FlowProfile.BASIC);\n\n      CompletableFuture\u003CStoredDocumentInfo> failedFuture =\n          CompletableFuture.failedFuture(new StorageException(\"S3 connection failed\"));\n      when(fileStorageService.uploadOriginalFile(any(), anyLong(), any(), any()))\n          .thenReturn(failedFuture);\n\n      \u002F\u002F ACT & ASSERT\n      assertThrows(\n          CompletionException.class,\n          () -> as2ProcessingService.processFile(testFilePath)\n      );\n    }\n\n    @Test\n    @DisplayName(\"Dosya yolu null olduğunda exception fırlatılmalı\")\n    void givenNullFilePath_whenProcessFile_thenThrowsException() {\n      \u002F\u002F ARRANGE\n      Path nullPath = null;\n\n      \u002F\u002F ACT & ASSERT\n      NullPointerException exception = assertThrows(\n          NullPointerException.class,\n          () -> as2ProcessingService.processFile(nullPath)\n      );\n\n      verify(invoiceFlowValidator, never()).validateFlowWithConfig(any(), any(), any(), any());\n    }\n  }\n}\n```\n\n### Temel Test Desenleri\n\n1. **@Nested Sınıflar**: Testleri test edilen metoda göre gruplandırın\n2. **@DisplayName**: Test raporlarında okunabilir açıklamalar sağlayın\n3. **İsimlendirme Kuralı**: Netlik için `givenX_whenY_thenZ`\n4. **AAA Deseni**: Açık `\u002F\u002F ARRANGE`, `\u002F\u002F ACT`, `\u002F\u002F ASSERT` yorumları\n5. **@BeforeEach**: Tekrarı azaltmak için ortak test verisi kurulumu\n6. **assertDoesNotThrow**: Exception yakalamadan başarı senaryolarını test edin\n7. **assertThrows**: AssertJ kullanarak mesaj doğrulamalı exception senaryolarını test edin\n8. **Kapsamlı Kapsam**: Mutlu yolları, null girdileri, edge case'leri, exception'ları test edin\n9. **Etkileşimleri Doğrulama**: Metodların doğru çağrıldığından emin olmak için Mockito `verify()` kullanın\n10. **Hiçbir Zaman Doğrulama**: Hata senaryolarında metodların ÇAĞRILMADIĞINI sağlamak için `never()` kullanın\n\n## Camel Route Testi\n\n```java\n@QuarkusTest\n@DisplayName(\"Business Rules Camel Route Tests\")\nclass BusinessRulesRouteTest {\n\n  @Inject\n  CamelContext camelContext;\n\n  @Inject\n  ProducerTemplate producerTemplate;\n\n  @InjectMock\n  EventService eventService;\n\n  private BusinessRulesPayload testPayload;\n\n  @BeforeEach\n  void setUp() {\n    \u002F\u002F ARRANGE - Test verisi\n    testPayload = new BusinessRulesPayload();\n    testPayload.setDocumentId(1L);\n    testPayload.setFlowProfile(FlowProfile.BASIC);\n  }\n\n  @Nested\n  @DisplayName(\"business-rules-publisher route için testler\")\n  class BusinessRulesPublisher {\n\n    @Test\n    @DisplayName(\"Mesajı başarıyla RabbitMQ'ya yayınlamalı\")\n    void givenValidPayload_whenPublish_thenMessageSentToQueue() throws Exception {\n      \u002F\u002F ARRANGE\n      MockEndpoint mockRabbitMQ = camelContext.getEndpoint(\"mock:rabbitmq\", MockEndpoint.class);\n      mockRabbitMQ.expectedMessageCount(1);\n\n      \u002F\u002F Test için gerçek endpoint'i mock ile değiştir\n      camelContext.getRouteController().stopRoute(\"business-rules-publisher\");\n      AdviceWith.adviceWith(camelContext, \"business-rules-publisher\", advice -> {\n        advice.replaceFromWith(\"direct:business-rules-publisher\");\n        advice.weaveByToString(\".*spring-rabbitmq.*\").replace().to(\"mock:rabbitmq\");\n      });\n      camelContext.getRouteController().startRoute(\"business-rules-publisher\");\n\n      \u002F\u002F ACT\n      producerTemplate.sendBody(\"direct:business-rules-publisher\", testPayload);\n\n      \u002F\u002F ASSERT — .marshal().json() sonrası body JSON String'dir\n      mockRabbitMQ.assertIsSatisfied(5000);\n\n      assertThat(mockRabbitMQ.getExchanges()).hasSize(1);\n      String body = mockRabbitMQ.getExchanges().get(0).getIn().getBody(String.class);\n      assertThat(body).contains(\"\\\"documentId\\\":1\");\n    }\n\n    @Test\n    @DisplayName(\"JSON'a marshalling'i ele almalı\")\n    void givenPayload_whenPublish_thenMarshalledToJson() throws Exception {\n      \u002F\u002F ARRANGE\n      MockEndpoint mockMarshal = new MockEndpoint(\"mock:marshal\");\n      camelContext.addEndpoint(\"mock:marshal\", mockMarshal);\n      mockMarshal.expectedMessageCount(1);\n\n      camelContext.getRouteController().stopRoute(\"business-rules-publisher\");\n      AdviceWith.adviceWith(camelContext, \"business-rules-publisher\", advice -> {\n        advice.weaveAddLast().to(\"mock:marshal\");\n      });\n      camelContext.getRouteController().startRoute(\"business-rules-publisher\");\n\n      \u002F\u002F ACT\n      producerTemplate.sendBody(\"direct:business-rules-publisher\", testPayload);\n\n      \u002F\u002F ASSERT\n      mockMarshal.assertIsSatisfied(5000);\n\n      String body = mockMarshal.getExchanges().get(0).getIn().getBody(String.class);\n      assertThat(body).contains(\"\\\"documentId\\\":1\");\n      assertThat(body).contains(\"\\\"flowProfile\\\":\\\"BASIC\\\"\");\n    }\n  }\n\n  @Nested\n  @DisplayName(\"document-processing route için testler\")\n  class DocumentProcessing {\n\n    @Test\n    @DisplayName(\"Faturayı doğru işlemciye yönlendirmeli\")\n    void givenInvoiceType_whenProcess_thenRoutesToInvoiceProcessor() throws Exception {\n      \u002F\u002F ARRANGE\n      MockEndpoint mockInvoice = camelContext.getEndpoint(\"mock:invoice\", MockEndpoint.class);\n      mockInvoice.expectedMessageCount(1);\n\n      camelContext.getRouteController().stopRoute(\"document-processing\");\n      AdviceWith.adviceWith(camelContext, \"document-processing\", advice -> {\n        advice.weaveByToString(\".*direct:process-invoice.*\").replace().to(\"mock:invoice\");\n      });\n      camelContext.getRouteController().startRoute(\"document-processing\");\n\n      \u002F\u002F ACT\n      producerTemplate.sendBodyAndHeader(\"direct:process-document\",\n          testPayload, \"documentType\", \"INVOICE\");\n\n      \u002F\u002F ASSERT\n      mockInvoice.assertIsSatisfied(5000);\n    }\n\n    @Test\n    @DisplayName(\"Validasyon hatalarını zarif şekilde ele almalı\")\n    void givenValidationError_whenProcess_thenRoutesToErrorHandler() throws Exception {\n      \u002F\u002F ARRANGE\n      MockEndpoint mockError = camelContext.getEndpoint(\"mock:error\", MockEndpoint.class);\n      mockError.expectedMessageCount(1);\n\n      camelContext.getRouteController().stopRoute(\"document-processing\");\n      AdviceWith.adviceWith(camelContext, \"document-processing\", advice -> {\n        advice.weaveByToString(\".*direct:validation-error-handler.*\")\n            .replace().to(\"mock:error\");\n      });\n      camelContext.getRouteController().startRoute(\"document-processing\");\n\n      \u002F\u002F Error event oluşturma hatasını gerçek EventService API'si üzerinden simüle et\n      doThrow(new ValidationException(\"Invalid document\"))\n          .when(eventService)\n          .createErrorEvent(any(), eq(\"VALIDATION_ERROR\"), anyString());\n\n      \u002F\u002F ACT\n      producerTemplate.sendBody(\"direct:process-document\", testPayload);\n\n      \u002F\u002F ASSERT\n      mockError.assertIsSatisfied(5000);\n\n      Exception exception = mockError.getExchanges().get(0).getException();\n      assertThat(exception).isInstanceOf(ValidationException.class);\n      assertThat(exception.getMessage()).contains(\"Invalid document\");\n    }\n  }\n}\n```\n\n## Event Service Testi\n\n```java\n@ExtendWith(MockitoExtension.class)\n@DisplayName(\"EventService Unit Tests\")\nclass EventServiceTest {\n\n  @Mock\n  private EventRepository eventRepository;\n\n  @Mock\n  private ObjectMapper objectMapper;\n\n  @InjectMocks\n  private EventService eventService;\n\n  private BusinessRulesPayload testPayload;\n\n  @BeforeEach\n  void setUp() {\n    \u002F\u002F ARRANGE\n    testPayload = new BusinessRulesPayload();\n    testPayload.setDocumentId(1L);\n  }\n\n  @Nested\n  @DisplayName(\"createSuccessEvent için testler\")\n  class CreateSuccessEvent {\n\n    @Test\n    @DisplayName(\"Doğru niteliklerle başarı eventi oluşturulmalı\")\n    void givenValidPayload_whenCreateSuccessEvent_thenEventPersisted() throws Exception {\n      \u002F\u002F ARRANGE\n      when(objectMapper.writeValueAsString(testPayload)).thenReturn(\"{\\\"documentId\\\":1}\");\n\n      \u002F\u002F ACT\n      assertDoesNotThrow(() ->\n          eventService.createSuccessEvent(testPayload, \"DOCUMENT_PROCESSED\"));\n\n      \u002F\u002F ASSERT\n      verify(eventRepository).persist(argThat(event ->\n          event.getType().equals(\"DOCUMENT_PROCESSED\") &&\n          event.getStatus() == EventStatus.SUCCESS &&\n          event.getPayload().equals(\"{\\\"documentId\\\":1}\") &&\n          event.getTimestamp() != null\n      ));\n    }\n\n    @Test\n    @DisplayName(\"Payload null olduğunda exception fırlatılmalı\")\n    void givenNullPayload_whenCreateSuccessEvent_thenThrowsException() {\n      \u002F\u002F ARRANGE\n      Object nullPayload = null;\n\n      \u002F\u002F ACT & ASSERT\n      NullPointerException exception = assertThrows(\n          NullPointerException.class,\n          () -> eventService.createSuccessEvent(nullPayload, \"EVENT_TYPE\")\n      );\n\n      assertThat(exception.getMessage()).isEqualTo(\"Payload cannot be null\");\n      verify(eventRepository, never()).persist(any());\n    }\n  }\n\n  @Nested\n  @DisplayName(\"createErrorEvent için testler\")\n  class CreateErrorEvent {\n\n    @Test\n    @DisplayName(\"Hata mesajıyla hata eventi oluşturulmalı\")\n    void givenError_whenCreateErrorEvent_thenEventPersistedWithMessage() throws Exception {\n      \u002F\u002F ARRANGE\n      String errorMessage = \"Processing failed\";\n      when(objectMapper.writeValueAsString(testPayload)).thenReturn(\"{\\\"documentId\\\":1}\");\n\n      \u002F\u002F ACT\n      assertDoesNotThrow(() ->\n          eventService.createErrorEvent(testPayload, \"PROCESSING_ERROR\", errorMessage));\n\n      \u002F\u002F ASSERT\n      verify(eventRepository).persist(argThat(event ->\n          event.getType().equals(\"PROCESSING_ERROR\") &&\n          event.getStatus() == EventStatus.ERROR &&\n          event.getErrorMessage().equals(errorMessage) &&\n          event.getPayload().equals(\"{\\\"documentId\\\":1}\")\n      ));\n    }\n\n    @ParameterizedTest\n    @DisplayName(\"Geçersiz hata mesajları reddedilmeli\")\n    @ValueSource(strings = {\"\", \" \"})\n    void givenBlankErrorMessage_whenCreateErrorEvent_thenThrowsException(String blankMessage) {\n      \u002F\u002F ACT & ASSERT\n      IllegalArgumentException exception = assertThrows(\n          IllegalArgumentException.class,\n          () -> eventService.createErrorEvent(testPayload, \"ERROR\", blankMessage)\n      );\n\n      assertThat(exception.getMessage()).contains(\"Error message cannot be blank\");\n    }\n  }\n}\n```\n\n## CompletableFuture Testi\n\n```java\n@ExtendWith(MockitoExtension.class)\n@DisplayName(\"FileStorageService Unit Tests\")\nclass FileStorageServiceTest {\n\n  @Mock\n  private S3Client s3Client;\n\n  @Mock\n  private ExecutorService executorService;\n\n  @InjectMocks\n  private FileStorageService fileStorageService;\n\n  private InputStream testInputStream;\n  private LogContext testLogContext;\n\n  @BeforeEach\n  void setUp() {\n    \u002F\u002F ARRANGE\n    testInputStream = new ByteArrayInputStream(\"test content\".getBytes());\n    testLogContext = new LogContext();\n    testLogContext.put(\"traceId\", \"trace-123\");\n  }\n\n  @Nested\n  @DisplayName(\"uploadOriginalFile için testler\")\n  class UploadOriginalFile {\n\n    @Test\n    @DisplayName(\"Dosyayı başarıyla yüklemeli ve belge bilgisi döndürmeli\")\n    void givenValidFile_whenUpload_thenReturnsDocumentInfo() throws Exception {\n      \u002F\u002F ARRANGE\n      doAnswer(invocation -> {\n        ((Runnable) invocation.getArgument(0)).run();\n        return null;\n      }).when(executorService).execute(any(Runnable.class));\n\n      when(s3Client.putObject(any(PutObjectRequest.class), any(RequestBody.class)))\n          .thenReturn(PutObjectResponse.builder().build());\n\n      \u002F\u002F ACT\n      CompletableFuture\u003CStoredDocumentInfo> future =\n          fileStorageService.uploadOriginalFile(testInputStream, 1024L,\n              testLogContext, InvoiceFormat.UBL);\n\n      StoredDocumentInfo result = future.join();\n\n      \u002F\u002F ASSERT\n      assertThat(result).isNotNull();\n      assertThat(result.getPath()).isNotBlank();\n      assertThat(result.getSize()).isEqualTo(1024L);\n      assertThat(result.getUploadedAt()).isNotNull();\n\n      verify(s3Client).putObject(any(PutObjectRequest.class), any(RequestBody.class));\n    }\n\n    @Test\n    @DisplayName(\"S3 yükleme başarısızlığını ele almalı\")\n    void givenS3Failure_whenUpload_thenCompletableFutureFails() {\n      \u002F\u002F ARRANGE\n      doAnswer(invocation -> {\n        ((Runnable) invocation.getArgument(0)).run();\n        return null;\n      }).when(executorService).execute(any(Runnable.class));\n\n      when(s3Client.putObject(any(PutObjectRequest.class), any(RequestBody.class)))\n          .thenThrow(new StorageException(\"S3 unavailable\"));\n\n      \u002F\u002F ACT\n      CompletableFuture\u003CStoredDocumentInfo> future =\n          fileStorageService.uploadOriginalFile(testInputStream, 1024L,\n              testLogContext, InvoiceFormat.UBL);\n\n      \u002F\u002F ASSERT\n      assertThatThrownBy(() -> future.join())\n          .isInstanceOf(CompletionException.class)\n          .hasCauseInstanceOf(StorageException.class)\n          .hasMessageContaining(\"S3 unavailable\");\n    }\n\n    @Test\n    @DisplayName(\"LogContext'i async işleme yaymalı\")\n    void givenLogContext_whenUpload_thenContextPropagated() throws Exception {\n      \u002F\u002F ARRANGE\n      AtomicReference\u003CLogContext> capturedContext = new AtomicReference\u003C>();\n\n      doAnswer(invocation -> {\n        capturedContext.set(CustomLog.getCurrentContext());\n        ((Runnable) invocation.getArgument(0)).run();\n        return null;\n      }).when(executorService).execute(any(Runnable.class));\n\n      \u002F\u002F ACT\n      fileStorageService.uploadOriginalFile(testInputStream, 1024L,\n          testLogContext, InvoiceFormat.UBL).join();\n\n      \u002F\u002F ASSERT\n      assertThat(capturedContext.get()).isNotNull();\n      assertThat(capturedContext.get().get(\"traceId\")).isEqualTo(\"trace-123\");\n    }\n  }\n}\n```\n\n## Resource Katmanı Testleri (REST Assured)\n\n```java\n@QuarkusTest\n@DisplayName(\"DocumentResource API Tests\")\nclass DocumentResourceTest {\n\n  @InjectMock\n  DocumentService documentService;\n\n  @Nested\n  @DisplayName(\"GET \u002Fapi\u002Fdocuments için testler\")\n  class ListDocuments {\n\n    @Test\n    @DisplayName(\"Belge listesini döndürmeli\")\n    void givenDocumentsExist_whenList_thenReturnsOk() {\n      \u002F\u002F ARRANGE\n      List\u003CDocument> documents = List.of(createDocument(1L, \"DOC-001\"));\n      when(documentService.list(0, 20)).thenReturn(documents);\n\n      \u002F\u002F ACT & ASSERT\n      given()\n          .when().get(\"\u002Fapi\u002Fdocuments\")\n          .then()\n          .statusCode(200)\n          .body(\"$.size()\", is(1))\n          .body(\"[0].referenceNumber\", equalTo(\"DOC-001\"));\n    }\n  }\n\n  @Nested\n  @DisplayName(\"POST \u002Fapi\u002Fdocuments için testler\")\n  class CreateDocument {\n\n    @Test\n    @DisplayName(\"Belge oluşturmalı ve 201 döndürmeli\")\n    void givenValidRequest_whenCreate_thenReturns201() {\n      \u002F\u002F ARRANGE\n      Document document = createDocument(1L, \"DOC-001\");\n      when(documentService.create(any())).thenReturn(document);\n\n      \u002F\u002F ACT & ASSERT\n      given()\n          .contentType(ContentType.JSON)\n          .body(\"\"\"\n              {\n                \"referenceNumber\": \"DOC-001\",\n                \"description\": \"Test document\",\n                \"validUntil\": \"2030-01-01T00:00:00Z\",\n                \"categories\": [\"test\"]\n              }\n              \"\"\")\n          .when().post(\"\u002Fapi\u002Fdocuments\")\n          .then()\n          .statusCode(201)\n          .header(\"Location\", containsString(\"\u002Fapi\u002Fdocuments\u002F1\"))\n          .body(\"referenceNumber\", equalTo(\"DOC-001\"));\n    }\n\n    @Test\n    @DisplayName(\"Geçersiz girdi için 400 döndürmeli\")\n    void givenInvalidRequest_whenCreate_thenReturns400() {\n      \u002F\u002F ACT & ASSERT\n      given()\n          .contentType(ContentType.JSON)\n          .body(\"\"\"\n              {\n                \"referenceNumber\": \"\",\n                \"description\": \"Test\"\n              }\n              \"\"\")\n          .when().post(\"\u002Fapi\u002Fdocuments\")\n          .then()\n          .statusCode(400);\n    }\n  }\n\n  private Document createDocument(Long id, String referenceNumber) {\n    Document document = new Document();\n    document.setId(id);\n    document.setReferenceNumber(referenceNumber);\n    document.setStatus(DocumentStatus.PENDING);\n    return document;\n  }\n}\n```\n\n## Gerçek Veritabanıyla Entegrasyon Testleri\n\n```java\n@QuarkusTest\n@TestProfile(IntegrationTestProfile.class)\n@DisplayName(\"Document Integration Tests\")\nclass DocumentIntegrationTest {\n\n  @Test\n  @Transactional\n  @DisplayName(\"Belge oluşturulmalı ve API üzerinden alınabilmeli\")\n  void givenNewDocument_whenCreateAndRetrieve_thenSuccessful() {\n    \u002F\u002F ACT - API üzerinden oluştur\n    Long id = given()\n        .contentType(ContentType.JSON)\n        .body(\"\"\"\n            {\n              \"referenceNumber\": \"INT-001\",\n              \"description\": \"Integration test\",\n              \"validUntil\": \"2030-01-01T00:00:00Z\",\n              \"categories\": [\"test\"]\n            }\n            \"\"\")\n        .when().post(\"\u002Fapi\u002Fdocuments\")\n        .then()\n        .statusCode(201)\n        .extract().path(\"id\");\n\n    \u002F\u002F ASSERT - API üzerinden al\n    given()\n        .when().get(\"\u002Fapi\u002Fdocuments\u002F\" + id)\n        .then()\n        .statusCode(200)\n        .body(\"referenceNumber\", equalTo(\"INT-001\"));\n  }\n}\n```\n\n## JaCoCo ile Kapsam\n\n### Maven Yapılandırması (Tam)\n\n```xml\n\u003Cplugin>\n  \u003CgroupId>org.jacoco\u003C\u002FgroupId>\n  \u003CartifactId>jacoco-maven-plugin\u003C\u002FartifactId>\n  \u003Cversion>0.8.13\u003C\u002Fversion>\n  \u003Cexecutions>\n    \u003C!-- Test yürütmesi için agent'ı hazırla -->\n    \u003Cexecution>\n      \u003Cid>prepare-agent\u003C\u002Fid>\n      \u003Cgoals>\n        \u003Cgoal>prepare-agent\u003C\u002Fgoal>\n      \u003C\u002Fgoals>\n    \u003C\u002Fexecution>\n\n    \u003C!-- Kapsam raporu oluştur -->\n    \u003Cexecution>\n      \u003Cid>report\u003C\u002Fid>\n      \u003Cphase>verify\u003C\u002Fphase>\n      \u003Cgoals>\n        \u003Cgoal>report\u003C\u002Fgoal>\n      \u003C\u002Fgoals>\n    \u003C\u002Fexecution>\n\n    \u003C!-- Kapsam eşiklerini zorla -->\n    \u003Cexecution>\n      \u003Cid>check\u003C\u002Fid>\n      \u003Cgoals>\n        \u003Cgoal>check\u003C\u002Fgoal>\n      \u003C\u002Fgoals>\n      \u003Cconfiguration>\n        \u003Crules>\n          \u003Crule>\n            \u003Celement>BUNDLE\u003C\u002Felement>\n            \u003Climits>\n              \u003Climit>\n                \u003Ccounter>LINE\u003C\u002Fcounter>\n                \u003Cvalue>COVEREDRATIO\u003C\u002Fvalue>\n                \u003Cminimum>0.80\u003C\u002Fminimum>\n              \u003C\u002Flimit>\n              \u003Climit>\n                \u003Ccounter>BRANCH\u003C\u002Fcounter>\n                \u003Cvalue>COVEREDRATIO\u003C\u002Fvalue>\n                \u003Cminimum>0.70\u003C\u002Fminimum>\n              \u003C\u002Flimit>\n            \u003C\u002Flimits>\n          \u003C\u002Frule>\n        \u003C\u002Frules>\n      \u003C\u002Fconfiguration>\n    \u003C\u002Fexecution>\n  \u003C\u002Fexecutions>\n\u003C\u002Fplugin>\n```\n\nKapsam ile testleri çalıştırın:\n```bash\nmvn clean test\nmvn jacoco:report\nmvn jacoco:check\n\n# Rapor: target\u002Fsite\u002Fjacoco\u002Findex.html\n```\n\n## Test Bağımlılıkları\n\n```xml\n\u003Cdependencies>\n    \u003C!-- Quarkus Test -->\n    \u003Cdependency>\n        \u003CgroupId>io.quarkus\u003C\u002FgroupId>\n        \u003CartifactId>quarkus-junit5\u003C\u002FartifactId>\n        \u003Cscope>test\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n    \u003Cdependency>\n        \u003CgroupId>io.quarkus\u003C\u002FgroupId>\n        \u003CartifactId>quarkus-junit5-mockito\u003C\u002FartifactId>\n        \u003Cscope>test\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n\n    \u003C!-- Mockito -->\n    \u003Cdependency>\n        \u003CgroupId>org.mockito\u003C\u002FgroupId>\n        \u003CartifactId>mockito-core\u003C\u002FartifactId>\n        \u003Cscope>test\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n\n    \u003C!-- AssertJ (JUnit assertion'larına tercih edilir) -->\n    \u003Cdependency>\n        \u003CgroupId>org.assertj\u003C\u002FgroupId>\n        \u003CartifactId>assertj-core\u003C\u002FartifactId>\n        \u003Cversion>3.24.2\u003C\u002Fversion>\n        \u003Cscope>test\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n\n    \u003C!-- REST Assured -->\n    \u003Cdependency>\n        \u003CgroupId>io.rest-assured\u003C\u002FgroupId>\n        \u003CartifactId>rest-assured\u003C\u002FartifactId>\n        \u003Cscope>test\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n\n    \u003C!-- Camel Test -->\n    \u003Cdependency>\n        \u003CgroupId>org.apache.camel.quarkus\u003C\u002FgroupId>\n        \u003CartifactId>camel-quarkus-junit5\u003C\u002FartifactId>\n        \u003Cscope>test\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n\u003C\u002Fdependencies>\n```\n\n## En İyi Uygulamalar\n\n### Test Organizasyonu\n- Testleri test edilen metoda göre gruplandırmak için `@Nested` sınıflar kullanın\n- Raporlarda görünür okunabilir açıklamalar için `@DisplayName` kullanın\n- Test metodları için `givenX_whenY_thenZ` isimlendirme kuralını izleyin\n- Tekrarı azaltmak için ortak test verisi kurulumunda `@BeforeEach` kullanın\n\n### Test Yapısı\n- Açık yorumlarla AAA desenini izleyin (`\u002F\u002F ARRANGE`, `\u002F\u002F ACT`, `\u002F\u002F ASSERT`)\n- Başarı senaryoları için `assertDoesNotThrow` kullanın\n- Mesaj doğrulamalı exception senaryoları için `assertThrows` kullanın\n- AssertJ `contains()` veya `isEqualTo()` kullanarak exception mesajlarının beklenen değerlerle eşleştiğini doğrulayın\n\n### Test Kapsamı\n- Tüm public metodlar için mutlu yolları test edin\n- Null girdi işlemeyi test edin\n- Edge case'leri test edin (boş koleksiyonlar, sınır değerleri, negatif ID'ler, boş string'ler)\n- Exception senaryolarını kapsamlı biçimde test edin\n- Tüm harici bağımlılıkları mock'layın (repository'ler, servisler, Camel endpoint'leri)\n- %80+ satır kapsamı, %70+ branch kapsamı hedefleyin\n\n### Assertion'lar\n- Değer kontrolleri için JUnit assertion'ları yerine **AssertJ'yi tercih edin** (`assertThat`)\n- Okunabilirlik için akıcı AssertJ API'si kullanın: `assertThat(list).hasSize(3).contains(item)`\n- Exception'lar için: JUnit `assertThrows` ile yakalayın, ardından AssertJ ile mesajı doğrulayın\n- Fırlatılmayan başarı yolları için: JUnit `assertDoesNotThrow` kullanın\n- Koleksiyonlar için: `extracting()`, `filteredOn()`, `containsExactly()`\n\n### Entegrasyon Testi\n- Entegrasyon testleri için `@QuarkusTest` kullanın\n- Quarkus testlerinde bağımlılıkları mock'lamak için `@InjectMock` kullanın\n- API testi için REST Assured'ı tercih edin\n- Test'e özel yapılandırma için `@TestProfile` kullanın\n\n### Event-Driven Test\n- `AdviceWith` ve `MockEndpoint` ile Camel route'larını test edin\n- `@CamelQuarkusTest` annotasyonu kullanın (bağımsız Camel testleri kullanıyorsanız)\n- Mesaj içeriğini, başlıklarını ve yönlendirme mantığını doğrulayın\n- Hata işleme route'larını ayrı ayrı test edin\n- Unit testlerde harici sistemleri (RabbitMQ, S3, veritabanları) mock'layın\n\n### Camel Route Testi\n- Mesaj akışını doğrulamak için `MockEndpoint` kullanın\n- Test için route'ları değiştirmek üzere `AdviceWith` kullanın (endpoint'leri mock'larla değiştirin)\n- Mesaj dönüşümünü ve marshalling'i test edin\n- Exception işleme ve dead letter queue'ları test edin\n\n### Async İşlem Testi\n- CompletableFuture başarı ve başarısızlık senaryolarını test edin\n- Async tamamlanmayı beklemek için testlerde `.join()` kullanın\n- CompletableFuture'dan exception yayılımını test edin\n- LogContext yayılımını async işlemlere doğrulayın\n\n### Performans\n- Testleri hızlı ve izole tutun\n- Testleri sürekli modda çalıştırın: `mvn quarkus:test`\n- Girdi varyasyonları için parametreli testler (`@ParameterizedTest`) kullanın\n- Yeniden kullanılabilir test verisi builder'ları veya factory metodları oluşturun\n\n### Quarkus'a Özgü\n- En son LTS sürümünde kalın (Quarkus 3.x)\n- Native derleme uyumluluğunu periyodik olarak test edin\n- Farklı senaryolar için Quarkus test profillerini kullanın\n- Yerel test için Quarkus dev servislerinden yararlanın\n- `@MockBean` yerine `@InjectMock` kullanın (Quarkus'a özgü)\n\n### Doğrulama En İyi Uygulamaları\n- Mock'lanmış bağımlılıklardaki etkileşimleri her zaman doğrulayın\n- Hata senaryolarında metodların ÇAĞRILMADIĞINI sağlamak için `verify(mock, never())` kullanın\n- Karmaşık argüman eşleştirme için `argThat()` kullanın\n- Önem taşıdığında çağrı sırasını doğrulayın: Mockito'dan `InOrder`\n",{"name":5,"origin":24,"description":7},"ECC","main","57e7aa6b6e03bce1a7d7862ba9c2ec312f7f19b5","src\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fdocs\u002Ftr\u002Fskills\u002Fquarkus-tdd",0,"https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee","https:\u002F\u002Fwithcyril.me\u002F","Hi, I’m Julian Cyril D, a Computer Science and Business Systems student at PSNACET.\r\nI’m passionate about full-stack development, UI\u002FUX design, and building sma","2026-11-04 23:28:50",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add Cyrilthetecchieee\u002Fcyril-code- --skill quarkus-tdd",{"tool":40,"command":41},"bunx","bunx skills add Cyrilthetecchieee\u002Fcyril-code- --skill quarkus-tdd",{"tool":43,"command":44},"pnpm","pnpm dlx skills add Cyrilthetecchieee\u002Fcyril-code- --skill quarkus-tdd","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fdocs\u002Ftr\u002Fskills\u002Fquarkus-tdd\u002FSKILL.md",true,[],[49,58,65,73,80,87],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":54,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M7AQV6CYX8RMC78420V9WZ62","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7AQV2895N3S1MEX6K76G6G2","youtube-downloader","Download YouTube videos with customizable quality and format options. Use this skill when the user asks to download, save, or grab YouTube videos. Supports various quality settings (best, 1080p, 720p, 480p, 360p), multiple formats (mp4, webm, mkv), and audio-only downloads as MP3.","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fvideo-downloader\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":69,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7AQTRNX62DNKVZ5GXEHRBKB","theme-factory","Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors\u002Ffonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Ftheme-factory\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Ftheme-factory\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7AQTNNVHAAN9H6DA8T6ZVE0","template-skill","Replace with description of the skill and when Claude should use it.","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Ftemplate-skill\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7AQTJ3MQ6AKX152MEX2MYCC","tailored-resume-generator","Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Ftailored-resume-generator\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":53,"licenseFileUrl":91,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7AQTD7D5MYET2YWG7HG9WM3","slack-gif-creator","Toolkit for creating animated GIFs optimized for Slack, with validators for size constraints and composable animation primitives. This skill applies when users request animated GIFs or emoji animations for Slack from descriptions like \"make me a GIF for Slack of X doing Y\".","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fslack-gif-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fslack-gif-creator\u002FSKILL.md",[],[]]