@@ -617,6 +617,35 @@ def test_auto_source_code_config_no_normalization(self) -> None:
617
617
class TestJavaDeriveCodeMappings (LanguageSpecificDeriveCodeMappings ):
618
618
platform = "java"
619
619
620
+ def test_marked_in_app_already (self ) -> None :
621
+ self ._process_and_assert_configuration_changes (
622
+ repo_trees = {REPO1 : ["src/com/example/foo/Bar.kt" ]},
623
+ # The developer may have marked the frame as in-app in the SDK
624
+ frames = [self .frame_from_module ("com.example.foo.Bar" , "Bar.kt" , in_app = True )],
625
+ platform = self .platform ,
626
+ expected_new_code_mappings = [self .code_mapping ("com/example/" , "src/com/example/" )],
627
+ expected_new_in_app_stack_trace_rules = [
628
+ "stack.module:com.example.** +app" ,
629
+ ],
630
+ )
631
+
632
+ def test_marked_in_app_and_code_mapping_already_exists (self ) -> None :
633
+ # The developer may have already created the code mapping and repository
634
+ self .create_repo_and_code_mapping ("REPO1" , "com/example/" , "src/com/example/" )
635
+ self ._process_and_assert_configuration_changes (
636
+ repo_trees = {REPO1 : ["src/com/example/foo/Bar.kt" ]},
637
+ # The developer may have marked the frame as in-app in the SDK
638
+ frames = [self .frame_from_module ("com.example.foo.Bar" , "Bar.kt" , in_app = True )],
639
+ platform = self .platform ,
640
+ # We're not expecting to create anything new
641
+ expected_new_code_mappings = [],
642
+ # The in-app rule will still be created
643
+ expected_new_in_app_stack_trace_rules = [
644
+ "stack.module:com.example.** +app" ,
645
+ ],
646
+ )
647
+ assert RepositoryProjectPathConfig .objects .count () == 1
648
+
620
649
def test_short_packages (self ) -> None :
621
650
self ._process_and_assert_configuration_changes (
622
651
repo_trees = {
0 commit comments