//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldHaveConfigsWithWildcardProcedureAllowedAndNoDefault() public virtual void ShouldHaveConfigsWithWildcardProcedureAllowedAndNoDefault() { Config config = Config.defaults(procedure_roles, "xyz*:anotherRole"); ProcedureConfig procConfig = new ProcedureConfig(config); assertThat(procConfig.RolesFor("xyzabc"), equalTo(ArrayOf("anotherRole"))); assertThat(procConfig.RolesFor("abcxyz"), equalTo(_empty)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldHaveConfigsWithExactMatchProcedureAllowed() public virtual void ShouldHaveConfigsWithExactMatchProcedureAllowed() { Config config = Config.defaults(stringMap(PROC_ALLOWED_SETTING_DEFAULT_NAME, "role1", PROC_ALLOWED_SETTING_ROLES, "xyz:anotherRole")); ProcedureConfig procConfig = new ProcedureConfig(config); assertThat(procConfig.RolesFor("xyz"), equalTo(ArrayOf("anotherRole"))); assertThat(procConfig.RolesFor("abc"), equalTo(ArrayOf("role1"))); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldSupportSeveralRolesPerPattern() public virtual void ShouldSupportSeveralRolesPerPattern() { Config config = Config.defaults(procedure_roles, "xyz*:role1,role2, role3 , role4 ; abc: role3 ,role1"); ProcedureConfig procConfig = new ProcedureConfig(config); assertThat(procConfig.RolesFor("xyzabc"), equalTo(ArrayOf("role1", "role2", "role3", "role4"))); assertThat(procConfig.RolesFor("abc"), equalTo(ArrayOf("role3", "role1"))); assertThat(procConfig.RolesFor("abcxyz"), equalTo(_empty)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldHaveConfigsWithDefaultProcedureAllowed() public virtual void ShouldHaveConfigsWithDefaultProcedureAllowed() { Config config = Config.defaults(default_allowed, "role1"); ProcedureConfig procConfig = new ProcedureConfig(config); assertThat(procConfig.RolesFor("x"), equalTo(ArrayOf("role1"))); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldHaveEmptyDefaultConfigs() public virtual void ShouldHaveEmptyDefaultConfigs() { Config config = Config.defaults(); ProcedureConfig procConfig = new ProcedureConfig(config); assertThat(procConfig.RolesFor("x"), equalTo(_empty)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldHaveConfigsWithMultipleWildcardProcedureAllowedAndNoDefault() public virtual void ShouldHaveConfigsWithMultipleWildcardProcedureAllowedAndNoDefault() { Config config = Config.defaults(procedure_roles, "apoc.convert.*:apoc_reader;apoc.load.json:apoc_writer;apoc.trigger.add:TriggerHappy"); ProcedureConfig procConfig = new ProcedureConfig(config); assertThat(procConfig.RolesFor("xyz"), equalTo(_empty)); assertThat(procConfig.RolesFor("apoc.convert.xml"), equalTo(ArrayOf("apoc_reader"))); assertThat(procConfig.RolesFor("apoc.convert.json"), equalTo(ArrayOf("apoc_reader"))); assertThat(procConfig.RolesFor("apoc.load.xml"), equalTo(_empty)); assertThat(procConfig.RolesFor("apoc.load.json"), equalTo(ArrayOf("apoc_writer"))); assertThat(procConfig.RolesFor("apoc.trigger.add"), equalTo(ArrayOf("TriggerHappy"))); assertThat(procConfig.RolesFor("apoc.convert-json"), equalTo(_empty)); assertThat(procConfig.RolesFor("apoc.load-xml"), equalTo(_empty)); assertThat(procConfig.RolesFor("apoc.load-json"), equalTo(_empty)); assertThat(procConfig.RolesFor("apoc.trigger-add"), equalTo(_empty)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldHaveConfigsWithOverlappingMatchingWildcards() public virtual void ShouldHaveConfigsWithOverlappingMatchingWildcards() { Config config = Config.defaults(stringMap(PROC_ALLOWED_SETTING_DEFAULT_NAME, "default", PROC_ALLOWED_SETTING_ROLES, "apoc.*:apoc;apoc.load.*:loader;apoc.trigger.*:trigger;apoc.trigger.add:TriggerHappy")); ProcedureConfig procConfig = new ProcedureConfig(config); assertThat(procConfig.RolesFor("xyz"), equalTo(ArrayOf("default"))); assertThat(procConfig.RolesFor("apoc.convert.xml"), equalTo(ArrayOf("apoc"))); assertThat(procConfig.RolesFor("apoc.load.xml"), equalTo(ArrayOf("apoc", "loader"))); assertThat(procConfig.RolesFor("apoc.trigger.add"), equalTo(ArrayOf("apoc", "trigger", "TriggerHappy"))); assertThat(procConfig.RolesFor("apoc.trigger.remove"), equalTo(ArrayOf("apoc", "trigger"))); assertThat(procConfig.RolesFor("apoc.load-xml"), equalTo(ArrayOf("apoc"))); }