-
Notifications
You must be signed in to change notification settings - Fork 881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
convert twilio unit test from groovy to java #13077
Conversation
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Jean Bisutti <[email protected]>
Co-authored-by: Jay DeLuca <[email protected]>
|
||
@Test | ||
void synchronousMessage() { | ||
twilioRestClient = mock(TwilioRestClient.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can skip this if you add @ExtendWith(MockitoExtension.class)
to the test class and @Mock
to the twilioRestClient
field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
CloseableHttpResponse response1 = mockResponse(MESSAGE_RESPONSE_BODY, 200); | ||
when(httpClient.execute(any())).thenReturn(response1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rename response1
-> response
or inline it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Show resolved
Hide resolved
...aagent/src/test/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioClientTest.java
Show resolved
Hide resolved
|
||
@Test | ||
void httpClient() throws IOException { | ||
CloseableHttpClient httpClient = mock(CloseableHttpClient.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to duplicated definitions in three different unit tests, how about extracting it out like twilioRestClient
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
relate to #7195