diff options
author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-05-15 06:41:15 +0200 |
---|---|---|
committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-05-15 06:41:15 +0200 |
commit | e70ec39488c0688d8144fa529d58d60ae9564fbd (patch) | |
tree | 07ef8e905d56b5ab2142f7a787d98317debcb38d /src/test/java/at/gv/egiz/moazs | |
parent | 1c252d7fc336831188c628ecdd39cd1b84b0cada (diff) | |
download | moa-zs-e70ec39488c0688d8144fa529d58d60ae9564fbd.tar.gz moa-zs-e70ec39488c0688d8144fa529d58d60ae9564fbd.tar.bz2 moa-zs-e70ec39488c0688d8144fa529d58d60ae9564fbd.zip |
WIP: Generate Map of Config Profiles from Spring Environment
Augmenter
- Replace default Config Profile with map of Config Profiles. Now,
Augmenter can choose a config profile at runtime and augment it.
- Move Augmenter to sub package.
WIP
- Implement ConfigProfileGenerator, which retrieves Config profiles
from Spring Environment and returns an easy-to-use map with
profiles that is keyed with profile id's.
- Replace application.properties with application.yaml.
- Remove Augmenter test cases: They need to be adapted.
Diffstat (limited to 'src/test/java/at/gv/egiz/moazs')
-rw-r--r-- | src/test/java/at/gv/egiz/moazs/DeliveryRequestAugmenterTest.java | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/src/test/java/at/gv/egiz/moazs/DeliveryRequestAugmenterTest.java b/src/test/java/at/gv/egiz/moazs/DeliveryRequestAugmenterTest.java index a98da74..a555bb9 100644 --- a/src/test/java/at/gv/egiz/moazs/DeliveryRequestAugmenterTest.java +++ b/src/test/java/at/gv/egiz/moazs/DeliveryRequestAugmenterTest.java @@ -1,5 +1,6 @@ package at.gv.egiz.moazs; +import at.gv.egiz.moazs.preprocess.DeliveryRequestAugmenter; import at.gv.zustellung.app2mzs.xsd.ConfigType; import at.gv.zustellung.app2mzs.xsd.DeliveryRequestType; import org.junit.Test; @@ -13,50 +14,50 @@ public class DeliveryRequestAugmenterTest { private final String msgUrl = "http://mzs"; - @Test - public void augmentPrimaryWithoutConfig() { - var fallback = createConfig(msgUrl, false); - var augmenter = new DeliveryRequestAugmenter(fallback); - - var actual = augmenter.augment(createRequest(null)).getConfig(); - - assertThat(actual).isEqualToComparingFieldByFieldRecursively(fallback); - } - - @Test - public void augmentPrimaryWithEmptyConfig() { - var fallback = createConfig(msgUrl, false); - var augmenter = new DeliveryRequestAugmenter(fallback); - var primary = createConfig(null, null); - - var actual = augmenter.augment(createRequest(primary)).getConfig(); - - assertThat(actual).isEqualToComparingFieldByFieldRecursively(fallback); - } - - @Test - public void overrideFallbacksUrlWithPrimary() { - var fallback = createConfig("http://fallback.url", false); - var primary = createConfig("http://primary.url", null); - var augmenter = new DeliveryRequestAugmenter(fallback); - - var actual = augmenter.augment(createRequest(primary)).getConfig(); - - var expected = createConfig("http://primary.url", false); - assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected); - } - - @Test - public void overrideFallbacksTvnzQueryWithPrimary() { - var fallback = createConfig(msgUrl, false); - var primary = createConfig(null, true); - var augmenter = new DeliveryRequestAugmenter(fallback); - - var actual = augmenter.augment(createRequest(primary)).getConfig(); - - var expected = createConfig(msgUrl, true); - assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected); - } +// @Test +// public void augmentPrimaryWithoutConfig() { +// var fallback = createConfig(msgUrl, false); +// var augmenter = new DeliveryRequestAugmenter(fallback, mzsMarshaller, deliveryRequestConfigs); +// +// var actual = augmenter.augment(createRequest(null)).getConfig(); +// +// assertThat(actual).isEqualToComparingFieldByFieldRecursively(fallback); +// } +// +// @Test +// public void augmentPrimaryWithEmptyConfig() { +// var fallback = createConfig(msgUrl, false); +// var augmenter = new DeliveryRequestAugmenter(fallback, mzsMarshaller, deliveryRequestConfigs); +// var primary = createConfig(null, null); +// +// var actual = augmenter.augment(createRequest(primary)).getConfig(); +// +// assertThat(actual).isEqualToComparingFieldByFieldRecursively(fallback); +// } +// +// @Test +// public void overrideFallbacksUrlWithPrimary() { +// var fallback = createConfig("http://fallback.url", false); +// var primary = createConfig("http://primary.url", null); +// var augmenter = new DeliveryRequestAugmenter(fallback, mzsMarshaller, deliveryRequestConfigs); +// +// var actual = augmenter.augment(createRequest(primary)).getConfig(); +// +// var expected = createConfig("http://primary.url", false); +// assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected); +// } +// +// @Test +// public void overrideFallbacksTvnzQueryWithPrimary() { +// var fallback = createConfig(msgUrl, false); +// var primary = createConfig(null, true); +// var augmenter = new DeliveryRequestAugmenter(fallback, mzsMarshaller, deliveryRequestConfigs); +// +// var actual = augmenter.augment(createRequest(primary)).getConfig(); +// +// var expected = createConfig(msgUrl, true); +// assertThat(actual).isEqualToComparingFieldByFieldRecursively(expected); +// } private ConfigType createConfig(String url, Boolean performTnvz) { |