+ msoBusinessLogic = new MsoBusinessLogicImpl(msoInterface, featureManager);
+ }
+
+ @Test
+ public void createConfigurationInstance_shouldCallMsoInterface_withCorrectServiceInstanceId() throws Exception {
+ // given
+ String serviceInstanceId = "3f93c7cb-2fd0-4557-9514-e189b7b04f9d";
+ String endpointTemplate = String.format("/serviceInstances/v6/%s/configurations", serviceInstanceId);
+ RequestDetailsWrapper requestDetailsWrapper = createRequestDetails("mso_request_create_configuration.json");
+ MsoResponseWrapper expectedResponse = createOkResponse();
+ given(msoInterface.createConfigurationInstance(requestDetailsWrapper, endpointTemplate))
+ .willReturn(expectedResponse);
+
+ // when
+ MsoResponseWrapper msoResponseWrapper = msoBusinessLogic
+ .createConfigurationInstance(requestDetailsWrapper, serviceInstanceId);
+
+ // then
+ assertThat(msoResponseWrapper).isEqualToComparingFieldByField(expectedResponse);
+ }
+
+ private RequestDetailsWrapper createRequestDetails(String bodyFileName) throws Exception {
+ final URL resource = this.getClass().getResource("/payload_jsons/" + bodyFileName);
+ RequestDetails requestDetails = objectMapper.readValue(resource, RequestDetails.class);
+ return new RequestDetailsWrapper(requestDetails);