Skip to content

Commit

Permalink
Try to fix test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lgiommi committed Oct 31, 2023
1 parent 6f986e7 commit 9811f94
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
import org.alien4cloud.tosca.model.templates.Topology;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.mitre.oauth2.model.RegisteredClient;
import org.mitre.openid.connect.client.service.ClientConfigurationService;
import org.mitre.openid.connect.client.service.impl.StaticClientConfigurationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
Expand All @@ -114,7 +115,7 @@ public class ImServiceImpl extends AbstractDeploymentProviderService {
private CustomOAuth2TemplateFactory templateFactory;

@Autowired
private StaticClientConfigurationService staticClientConfigurationService;
private ClientConfigurationService staticClientConfigurationService;

@Autowired
private ToscaService toscaService;
Expand Down Expand Up @@ -271,13 +272,13 @@ public boolean doDeploy(DeploymentMessage deploymentMessage) {
String issuerNode;
String tokenCredentials = null;
Map<String, String> clientCreated = new HashMap<>();
Map<String, RegisteredClient> orchestratorClients = new HashMap<>();
final Map<String, RegisteredClient> orchestratorClients =
((StaticClientConfigurationService) staticClientConfigurationService).getClients();

// Get properties of IAM_TOSCA_NODE_TYPE nodes from the TOSCA template and
// get information about the clients related to the orchestrator
if (iamTemplateInput == null) {
iamTemplateInput = toscaService.getIamProperties(ar);
orchestratorClients = staticClientConfigurationService.getClients();
}

// Set the issuer of the current node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
package it.reply.orchestrator.config.specific;

import com.github.springtestdbunit.DbUnitTestExecutionListener;

import it.reply.orchestrator.IntegrationTest;
import it.reply.orchestrator.annotation.SpringTestProfile;

import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.mitre.openid.connect.client.service.ClientConfigurationService;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.TestExecutionListeners.MergeMode;
Expand All @@ -39,4 +39,6 @@
@TestExecutionListeners(listeners = { DbUnitTestExecutionListener.class },
mergeMode = MergeMode.MERGE_WITH_DEFAULTS)
public abstract class WebAppConfigurationAwareIT {
@MockBean
private ClientConfigurationService staticClientConfigurationService;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@

package it.reply.orchestrator.controller;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import it.reply.orchestrator.config.specific.WebAppConfigurationAwareIT;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand All @@ -32,6 +28,8 @@
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

public class MiscControllerIT extends WebAppConfigurationAwareIT {

Expand Down

0 comments on commit 9811f94

Please sign in to comment.