File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
fabric-chaincode-shim/src/test/java/org/hyperledger/fabric/shim Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 3333import org .junit .Rule ;
3434import org .junit .Test ;
3535import org .junit .contrib .java .lang .system .EnvironmentVariables ;
36+ import org .junit .jupiter .api .AfterEach ;
3637import org .junit .jupiter .api .Assertions ;
3738import org .junit .rules .ExpectedException ;
3839import org .mockito .ArgumentCaptor ;
@@ -47,6 +48,16 @@ public class ChaincodeBaseTest {
4748 @ Rule
4849 public ExpectedException thrown = ExpectedException .none ();
4950
51+ @ AfterEach
52+ void clearEnv () {
53+ environmentVariables .clear ("CORE_CHAINCODE_ID_NAME" );
54+ environmentVariables .clear ("CORE_PEER_ADDRESS" );
55+ environmentVariables .clear ("CORE_PEER_TLS_ENABLED" );
56+ environmentVariables .clear ("CORE_PEER_TLS_ROOTCERT_FILE" );
57+ environmentVariables .clear ("CORE_TLS_CLIENT_KEY_PATH" );
58+ environmentVariables .clear ("CORE_TLS_CLIENT_CERT_PATH" );
59+ }
60+
5061 @ Test
5162 public void testNewSuccessResponseEmpty () {
5263 final org .hyperledger .fabric .shim .Chaincode .Response response = ResponseUtils .newSuccessResponse ();
Original file line number Diff line number Diff line change 1414import org .hyperledger .fabric .shim .chaincode .EmptyChaincode ;
1515import org .junit .Rule ;
1616import org .junit .contrib .java .lang .system .EnvironmentVariables ;
17+ import org .junit .jupiter .api .AfterEach ;
1718import org .junit .jupiter .api .Assertions ;
1819import org .junit .jupiter .api .BeforeEach ;
1920import org .junit .jupiter .api .Test ;
@@ -38,6 +39,16 @@ void setEnv() {
3839 environmentVariables .set ("CORE_TLS_CLIENT_CERT_PATH" , "src/test/resources/client.crt.enc" );
3940 }
4041
42+ @ AfterEach
43+ void clearEnv () {
44+ environmentVariables .clear ("CORE_CHAINCODE_ID_NAME" );
45+ environmentVariables .clear ("CORE_PEER_ADDRESS" );
46+ environmentVariables .clear ("CORE_PEER_TLS_ENABLED" );
47+ environmentVariables .clear ("CORE_PEER_TLS_ROOTCERT_FILE" );
48+ environmentVariables .clear ("CORE_TLS_CLIENT_KEY_PATH" );
49+ environmentVariables .clear ("CORE_TLS_CLIENT_CERT_PATH" );
50+ }
51+
4152 @ Test
4253 void getManager () throws IOException {
4354
You can’t perform that action at this time.
0 commit comments