Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added microservice entry-point #278

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Nikita-Smirnov-Exactpro
Copy link
Member

No description provided.

@Nikita-Smirnov-Exactpro
Copy link
Member Author

This change should include two features:

  • microservice entry-point
  • configuration provider

dictionaryAliasesDir = defaultPathIfNull(settings.getDictionaryAliasesDir(), settings.getBaseConfigDir(), DICTIONARY_ALIAS_DIR_NAME);
oldDictionariesDir = defaultPathIfNull(settings.getOldDictionariesDir(), settings.getBaseConfigDir(), "");

configurationProvider = createConfigurationProvider(settings);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we should be able to inject this into common factory (for test purposes and for possible customization)

Comment on lines 159 to 161
IConfigurationProvider getConfigurationProvider() {
return configurationProvider;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having this getter adds one more reason to be able to inject the provider from outside

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussion, the method should be left but made public

Comment on lines 119 to 120
final IConfigurationProvider configurationProvider;
final ConfigurationManager configurationManager;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They probably, should be private

import kotlin.io.path.exists


class JsonConfigurationProvider @JvmOverloads constructor(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should make the constructor private and create factory methods creating an instance of JsonConfigurationProvider

@Nikita-Smirnov-Exactpro
Copy link
Member Author

Discussion results:
Common factory constructors:

  • migrate from constructors to separate static methods
  • user can be able to create common factory via craterFromArgs(vararg args: String) and createFromProvider(provider: IConfigurationProvider). Other ways should be deprecated

Common factory methods:

  • public <T> T getConfiguration(Path configPath, Class<T> configClass, ObjectMapper customObjectMapper) should be removed because this method can be implemented out side from common factory
  • protected abstract Path getPathToCustomConfiguration() should be removed after createFromProvider implementation

JsonConfigurationProvider:

  • public constructor should be replaced to a static method
  • class should be public because it is useful for tests

Copy link

github-actions bot commented Jun 14, 2024

Test Results

 33 files   33 suites   6s ⏱️
428 tests 428 ✅ 0 💤 0 ❌
535 runs  535 ✅ 0 💤 0 ❌

Results for commit 0fde596.

♻️ This comment has been updated with latest results.

@Nikita-Smirnov-Exactpro Nikita-Smirnov-Exactpro changed the base branch from dev-version-5 to master June 26, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants