import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
import com.google.common.util.concurrent.ListenableFuture;
+import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.transportpce.pce.service.PathComputationService;
import org.opendaylight.transportpce.servicehandler.utils.ServiceDataUtils;
import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.CancelResourceReserveInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.CancelResourceReserveOutput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.CancelResourceReserveOutputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestOutput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev210701.CancelResourceReserveInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev210701.CancelResourceReserveOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev210701.CancelResourceReserveOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev210701.PathComputationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev210701.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev210701.PathComputationRequestOutputBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev190531.ServiceNotificationTypes;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev190531.configuration.response.common.ConfigurationResponseCommon;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev190531.configuration.response.common.ConfigurationResponseCommonBuilder;
@InjectMocks
private PCEServiceWrapper pceServiceWrapperMock;
+ private AutoCloseable closeable;
+
@Before
- public void init() throws NoSuchMethodException {
- MockitoAnnotations.initMocks(this);
+ public void openMocks() throws NoSuchMethodException {
+ closeable = MockitoAnnotations.openMocks(this);
}
@Test
pceResponse.getConfigurationResponseCommon().getAckFinalIndicator());
Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
pceResponse.getConfigurationResponseCommon().getResponseCode());
- verifyZeroInteractions(this.pathComputationServiceMock);
+ Mockito.verifyNoInteractions(this.pathComputationServiceMock);
}
@Test
pceResponse.getConfigurationResponseCommon().getAckFinalIndicator());
Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
pceResponse.getConfigurationResponseCommon().getResponseCode());
- verifyZeroInteractions(this.pathComputationServiceMock);
+ Mockito.verifyNoInteractions(this.pathComputationServiceMock);
}
@Test
pceResponse.getConfigurationResponseCommon().getAckFinalIndicator());
Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
pceResponse.getConfigurationResponseCommon().getResponseCode());
- verifyZeroInteractions(this.pathComputationServiceMock);
+ Mockito.verifyNoInteractions(this.pathComputationServiceMock);
}
pceResponse.getConfigurationResponseCommon().getAckFinalIndicator());
Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
pceResponse.getConfigurationResponseCommon().getResponseCode());
- verifyZeroInteractions(this.pathComputationServiceMock);
+ Mockito.verifyNoInteractions(this.pathComputationServiceMock);
}
@Test
pceResponse.getConfigurationResponseCommon().getResponseMessage());
verify(this.pathComputationServiceMock).pathComputationRequest((any(PathComputationRequestInput.class)));
}
+
+ @After public void releaseMocks() throws Exception {
+ closeable.close();
+ }
}