use of uk.gov.ida.hub.config.domain.remoteconfig.SelfServiceMetadata in project verify-hub by alphagov.
the class ManagedEntityConfigRepositoryTest method setUp.
@BeforeEach
public void setUp() throws Exception {
URL url = this.getClass().getResource("/remote-test-config.json");
File initialFile = new File(url.getFile());
InputStream inputStream = new FileInputStream(initialFile);
ObjectMapper om = new ObjectMapper();
SelfServiceMetadata selfServiceMetadata = om.readValue(inputStream, SelfServiceMetadata.class);
RemoteConfigCollection remoteConfigCollection = new RemoteConfigCollection(null, selfServiceMetadata);
when(s3ConfigSource.getRemoteConfig()).thenReturn(remoteConfigCollection);
when(localConfigRepository.getData(LOCAL_ONLY_ENTITY_ID)).thenReturn(Optional.of(localOnlyTransaction));
when(localConfigRepository.getData(REMOTE_ENABLED_ENTITY_ID)).thenReturn(Optional.of(remoteEnabledTransaction));
when(localConfigRepository.getData(REMOTE_DISABLED_ENTITY_ID)).thenReturn(Optional.of(remoteDisabledTransaction));
}
Aggregations