-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Sofa test #512
Sofa test #512
Conversation
Codecov Report
@@ Coverage Diff @@
## master #512 +/- ##
============================================
- Coverage 15.08% 14.98% -0.11%
- Complexity 115 294 +179
============================================
Files 124 251 +127
Lines 2340 5172 +2832
Branches 274 489 +215
============================================
+ Hits 353 775 +422
- Misses 1927 4305 +2378
- Partials 60 92 +32
Continue to review full report at Codecov.
|
<groupId>io.projectreactor</groupId> | ||
<artifactId>reactor-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
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.
add blank line
* @author tydhot | ||
*/ | ||
@RunWith(MockitoJUnitRunner.class) | ||
public class SofaPluginTest { |
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.
add final
SelectorData selectorData = mock(SelectorData.class); | ||
StepVerifier.create(sofaPlugin.doExecute(exchange, chain, selectorData, data)).expectSubscription().verifyComplete(); | ||
} | ||
|
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.
remove empty line
* @author tydhot | ||
*/ | ||
@RunWith(MockitoJUnitRunner.class) | ||
public class SofaPluginDataHandlerTest { |
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.
add final
sofaPluginDataHandler.handlerPlugin(pluginData); | ||
Assert.assertNull(Singleton.INST.get(SofaRegisterConfig.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.
remove empty line
formExchange.getAttributes().put(Constants.CONTEXT, context); | ||
StepVerifier.create(bodyParamPlugin.execute(formExchange, chain)).expectSubscription().verifyComplete(); | ||
} | ||
|
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.
remove empty line
import reactor.core.publisher.Mono; | ||
import reactor.test.StepVerifier; | ||
|
||
|
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.
remove empty line
Mockito.when(chain.execute(exchange)).thenReturn(Mono.empty()); | ||
sofaResponsePlugin = new SofaResponsePlugin(); | ||
exchange.getAttributes().put(Constants.SOFA_RPC_RESULT, response); | ||
|
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.
remove empty line
|
||
StepVerifier.create(sofaResponsePlugin.execute(exchange, chain)).expectSubscription().verifyError(NullPointerException.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.
remove empty line
} | ||
|
||
@Test(expected = SofaRpcRuntimeException.class) | ||
public void test01OnSubscribe() { |
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.
modify test Name
Whether the test needs to be standardized? We can divide it into functions, logic, and scenarios. What do you think? I think this can be used as a judgment at the time of review. can improve code quality. @yu199195 @dengliming |
we should in other issue discuss the question |
Make sure that:
mvn clean install -Dmaven.javadoc.skip=true
.