Skip to content
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

Merged
merged 4 commits into from
Dec 4, 2020
Merged

Sofa test #512

merged 4 commits into from
Dec 4, 2020

Conversation

tydhot
Copy link
Member

@tydhot tydhot commented Dec 4, 2020

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed mvn clean install -Dmaven.javadoc.skip=true.

@codecov-io
Copy link

Codecov Report

Merging #512 (1ec72ee) into master (92b7584) will decrease coverage by 0.10%.
The diff coverage is n/a.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ Complexity Δ
...romara/soul/admin/exception/ExceptionHandlers.java 18.18% <0.00%> (ø) 2.00% <0.00%> (?%)
...n/java/org/dromara/soul/admin/dto/AuthPathDTO.java 0.00% <0.00%> (ø) 0.00% <0.00%> (?%)
...org/dromara/soul/admin/entity/DashboardUserDO.java 0.00% <0.00%> (ø) 0.00% <0.00%> (?%)
...g/dromara/soul/admin/query/DashboardUserQuery.java 0.00% <0.00%> (ø) 0.00% <0.00%> (?%)
.../dromara/soul/admin/config/HttpSyncProperties.java 0.00% <0.00%> (ø) 0.00% <0.00%> (?%)
...tener/http/HttpLongPollingDataChangedListener.java 0.00% <0.00%> (ø) 0.00% <0.00%> (?%)
...va/org/dromara/soul/admin/dto/AuthPathWarpDTO.java 0.00% <0.00%> (ø) 0.00% <0.00%> (?%)
...ain/java/org/dromara/soul/admin/dto/PluginDTO.java 0.00% <0.00%> (ø) 0.00% <0.00%> (?%)
...mara/soul/admin/config/ZookeeperConfiguration.java 0.00% <0.00%> (ø) 0.00% <0.00%> (?%)
...org/dromara/soul/admin/result/SoulAdminResult.java 52.63% <0.00%> (ø) 6.00% <0.00%> (?%)
... and 120 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92b7584...1ec72ee. Read the comment docs.

<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Copy link
Member

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 {
Copy link
Member

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();
}

Copy link
Member

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 {
Copy link
Member

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));
}

Copy link
Member

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();
}

Copy link
Member

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;


Copy link
Member

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);

Copy link
Member

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);
}

Copy link
Member

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() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modify test Name

@yu199195 yu199195 added this to the 2.3.0 milestone Dec 4, 2020
@yu199195 yu199195 merged commit 466c846 into apache:master Dec 4, 2020
@nuo-promise
Copy link
Contributor

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

@yu199195
Copy link
Member

yu199195 commented Dec 4, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants