veselov commented on a change in pull request #295:
URL: 
https://github.com/apache/httpcomponents-core/pull/295#discussion_r667502678



##########
File path: httpcore/src/test/java/org/apache/http/ssl/DummyProvider.java
##########
@@ -0,0 +1,64 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.http.ssl;
+
+import java.security.Provider;
+import java.security.Security;
+import java.util.HashSet;
+import java.util.Set;
+
+public class DummyProvider extends Provider {

Review comment:
       I've tried using `Mockito.spy` on returned `Service` objects to alter 
the `Service.getProvider()` response - that would have made it easier to test 
whether the provider was used. However, that was failing with some security 
exceptions. As to replacing the `DummyProvider` with a spied on class - I'm not 
sure how I can do that - i.e. what would I spy on, since the whole point of the 
change is for me to supply some alternative provider, so I need to use an 
implementation of `Provider`, and that's an abstract class.
   
   Said that, I'm really not well versed on Mockito, if you have ideas how this 
can be simplified - I'll gladly adopt them.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to