@@ -859,34 +859,21 @@ abstract class HttpWsTestCaseWriter : ApiTestCaseWriter() {
859859 private fun handleCallbackVerifierRequests (lines : Lines , action : Action , verifier : ActionStubMapping , assertTrue : Boolean ) {
860860 if (assertTrue) {
861861 lines.addSingleCommentLine(" Verifying that the request is successfully made to HttpCallbackVerifier after test execution." )
862- lines.add(" assertTrue(${verifier.getVerifierName()} " )
862+ lines.add(" assertTrue(callbackVerifierHasServed(${verifier.getVerifierName()} , \" ${action.getName()} \" ))" )
863+ // lines.add("assertTrue(${verifier.getVerifierName()}")
863864 } else {
864865 lines.addSingleCommentLine(" Verifying that there are no requests made to HttpCallbackVerifier before test execution." )
865- lines.add(" assertFalse(${verifier.getVerifierName()} " )
866- }
867- lines.indented {
868- if (format.isKotlin()) {
869- lines.add(" .allServeEvents" )
870- lines.add(" .filter { it.wasMatched && it.stubMapping.metadata != null }" )
871- lines.add(" .any { it.stubMapping.metadata.getString(\" ssrf\" ) == \" ${action.getName()} \" }" )
872- }
873- }
874- lines.add(" )" )
875- }
876-
877- private fun ssrfAssertionsUtilFunction (lines : Lines , action : Action , verifier : ActionStubMapping , assertTrue : Boolean ) {
878- // TODO: Add function
879- // lines.add()
880- lines.indented {
881- lines.add(verifier.getVerifierName())
882- lines.indented {
883- if (format.isKotlin()) {
884- lines.add(" .allServeEvents" )
885- lines.add(" .filter { it.wasMatched && it.stubMapping.metadata != null }" )
886- lines.add(" .any { it.stubMapping.metadata.getString(\" ssrf\" ) == \" ${action.getName()} \" }" )
887- }
888- }
889- }
866+ // lines.add("assertFalse(${verifier.getVerifierName()}")
867+ lines.add(" assertFalse(callbackVerifierHasServed(${verifier.getVerifierName()} , \" ${action.getName()} \" ))" )
868+ }
869+ // lines.indented {
870+ // if (format.isKotlin()) {
871+ // lines.add(".allServeEvents")
872+ // lines.add(".filter { it.wasMatched && it.stubMapping.metadata != null }")
873+ // lines.add(".any { it.stubMapping.metadata.getString(\"ssrf\") == \"${action.getName()}\" }")
874+ // }
875+ // }
876+ // lines.add(")")
890877 }
891878
892879}
0 commit comments