This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "rustls-sni" | |
version = "0.1.0" | |
edition = "2021" | |
[dev-dependencies] | |
rustls = "0.22" | |
tokio-rustls = "0.25" | |
curl = "0.4" | |
reqwest = "0.11" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[cfg(test)] | |
mod tests { | |
use crate::GithubClient; | |
use httpmock::MockServer; | |
use serde_json::json; | |
#[test] | |
fn create_repo_success_test() { | |
// Arrange | |
let server = MockServer::start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use isahc::{ReadResponseExt, Request, RequestExt}; | |
use serde_json::{json, Value}; | |
use anyhow::{Result,ensure}; | |
pub struct GithubClient { | |
base_url: String, | |
token: String, | |
} | |
impl GithubClient { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
At least one request has been received, but none exactly matched the mock specification. | |
Here is a comparison with the most similar request (request number 1): | |
1 : Expected header with name 'Content-Type' and value 'application/json' to be present in the request but it wasn't. | |
------------------------------------------------------------------------------------------ | |
Expected: [key=equals, value=equals] Content-Type=application/json | |
Actual (closest match): content-type=text/plain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[dev-dependencies] | |
httpmock = "0.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Library | Execution | Pooling | Custom Matchers | Mockable APIs | Sync | Async | Stand-alone Mode | |
---|---|---|---|---|---|---|---|---|
mockito | serial | no | no | 1 | yes | no | no | |
httpmock | parallel | yes | yes | unlimited | yes | yes | yes | |
httptest | parallel | yes | yes | unlimited | yes | no | no | |
wiremock | parallel | no | yes | unlimited | no | yes | no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[dependencies] | |
isahc = { version = "1.6", features = ["json"]} | |
serde_json = "1.0" | |
anyhow = "1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Make sure you have the logback encoder in your dependencies: | |
<dependency> | |
<groupId>net.logstash.logback</groupId> | |
<artifactId>logstash-logback-encoder</artifactId> | |
<version>5.2</version> | |
</dependency> | |
--> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef SMOOTHER_H | |
#define SMOOTHER_H | |
#include <math.h> | |
class Smoother { | |
private: | |
double mSampleRate; | |
double mLastOutput{}; | |
double mA{}; |