@@ -646,7 +646,7 @@ func Test_DoguFormatProvider_WriteDoguToString(t *testing.T) {
646
646
}
647
647
dogu := Dogu {Name : "jenkins" , Version : "1.625.2" , DisplayName : "Jenkins CI" , Dependencies : expectedDependencies }
648
648
expectedRepresentationV1 := "{\" Name\" :\" jenkins\" ,\" Version\" :\" 1.625.2\" ,\" PublishedAt\" :\" 0001-01-01T00:00:00Z\" ,\" DisplayName\" :\" Jenkins CI\" ,\" Description\" :\" \" ,\" Category\" :\" \" ,\" Tags\" :null,\" Logo\" :\" \" ,\" URL\" :\" \" ,\" Image\" :\" \" ,\" ExposedPorts\" :null,\" ExposedCommands\" :null,\" Volumes\" :null,\" HealthCheck\" :{\" Type\" :\" \" ,\" State\" :\" \" ,\" Port\" :0,\" Path\" :\" \" ,\" Parameters\" :null},\" HealthChecks\" :null,\" ServiceAccounts\" :null,\" Privileged\" :false,\" Configuration\" :null,\" Properties\" :null,\" EnvironmentVariables\" :null,\" Dependencies\" :[\" cas\" ],\" OptionalDependencies\" :null}"
649
- expectedRepresentationV2 := "{\" Name\" :\" jenkins\" ,\" Version\" :\" 1.625.2\" ,\" PublishedAt\" :\" 0001-01-01T00:00:00Z\" ,\" DisplayName\" :\" Jenkins CI\" ,\" Description\" :\" \" ,\" Category\" :\" \" ,\" Tags\" :null,\" Logo\" :\" \" ,\" URL\" :\" \" ,\" Image\" :\" \" ,\" ExposedPorts\" :null,\" ExposedCommands\" :null,\" Volumes\" :null,\" HealthCheck\" :{\" Type\" :\" \" ,\" State\" :\" \" ,\" Port\" :0,\" Path\" :\" \" ,\" Parameters\" :null},\" HealthChecks\" :null,\" ServiceAccounts\" :null,\" Privileged\" :false,\" Configuration\" :null,\" Properties\" :null,\" EnvironmentVariables\" :null,\" Dependencies\" :[{\" type\" :\" dogu\" ,\" name\" :\" cas\" ,\" version\" :\" \" }],\" OptionalDependencies\" :null}"
649
+ expectedRepresentationV2 := "{\" Name\" :\" jenkins\" ,\" Version\" :\" 1.625.2\" ,\" PublishedAt\" :\" 0001-01-01T00:00:00Z\" ,\" DisplayName\" :\" Jenkins CI\" ,\" Description\" :\" \" ,\" Category\" :\" \" ,\" Tags\" :null,\" Logo\" :\" \" ,\" URL\" :\" \" ,\" Image\" :\" \" ,\" ExposedPorts\" :null,\" ExposedCommands\" :null,\" Volumes\" :null,\" HealthCheck\" :{\" Type\" :\" \" ,\" State\" :\" \" ,\" Port\" :0,\" Path\" :\" \" ,\" Parameters\" :null},\" HealthChecks\" :null,\" ServiceAccounts\" :null,\" Privileged\" :false,\" Security \" :{ \" Capabilities \" :{}, \" RunAsNonRoot \" :false, \" ReadOnlyRootFileSystem \" :false}, \" Configuration\" :null,\" Properties\" :null,\" EnvironmentVariables\" :null,\" Dependencies\" :[{\" type\" :\" dogu\" ,\" name\" :\" cas\" ,\" version\" :\" \" }],\" OptionalDependencies\" :null}"
650
650
651
651
t .Run ("Convert given dogu object into the string representation" , func (t * testing.T ) {
652
652
tests := []formatTest {
@@ -682,7 +682,7 @@ func Test_DoguFormatProvider_WriteDogusToString(t *testing.T) {
682
682
dogu2 := Dogu {Name : "scm" , Version : "2.625.2" , DisplayName : "Scm Manager" , Dependencies : expectedDependencies }
683
683
dogus := []* Dogu {& dogu1 , & dogu2 }
684
684
expectedRepresentationV1 := "[{\" Name\" :\" jenkins\" ,\" Version\" :\" 1.625.2\" ,\" PublishedAt\" :\" 0001-01-01T00:00:00Z\" ,\" DisplayName\" :\" Jenkins CI\" ,\" Description\" :\" \" ,\" Category\" :\" \" ,\" Tags\" :null,\" Logo\" :\" \" ,\" URL\" :\" \" ,\" Image\" :\" \" ,\" ExposedPorts\" :null,\" ExposedCommands\" :null,\" Volumes\" :null,\" HealthCheck\" :{\" Type\" :\" \" ,\" State\" :\" \" ,\" Port\" :0,\" Path\" :\" \" ,\" Parameters\" :null},\" HealthChecks\" :null,\" ServiceAccounts\" :null,\" Privileged\" :false,\" Configuration\" :null,\" Properties\" :null,\" EnvironmentVariables\" :null,\" Dependencies\" :[\" cas\" ],\" OptionalDependencies\" :null},{\" Name\" :\" scm\" ,\" Version\" :\" 2.625.2\" ,\" PublishedAt\" :\" 0001-01-01T00:00:00Z\" ,\" DisplayName\" :\" Scm Manager\" ,\" Description\" :\" \" ,\" Category\" :\" \" ,\" Tags\" :null,\" Logo\" :\" \" ,\" URL\" :\" \" ,\" Image\" :\" \" ,\" ExposedPorts\" :null,\" ExposedCommands\" :null,\" Volumes\" :null,\" HealthCheck\" :{\" Type\" :\" \" ,\" State\" :\" \" ,\" Port\" :0,\" Path\" :\" \" ,\" Parameters\" :null},\" HealthChecks\" :null,\" ServiceAccounts\" :null,\" Privileged\" :false,\" Configuration\" :null,\" Properties\" :null,\" EnvironmentVariables\" :null,\" Dependencies\" :[\" cas\" ],\" OptionalDependencies\" :null}]"
685
- expectedRepresentationV2 := "[{\" Name\" :\" jenkins\" ,\" Version\" :\" 1.625.2\" ,\" PublishedAt\" :\" 0001-01-01T00:00:00Z\" ,\" DisplayName\" :\" Jenkins CI\" ,\" Description\" :\" \" ,\" Category\" :\" \" ,\" Tags\" :null,\" Logo\" :\" \" ,\" URL\" :\" \" ,\" Image\" :\" \" ,\" ExposedPorts\" :null,\" ExposedCommands\" :null,\" Volumes\" :null,\" HealthCheck\" :{\" Type\" :\" \" ,\" State\" :\" \" ,\" Port\" :0,\" Path\" :\" \" ,\" Parameters\" :null},\" HealthChecks\" :null,\" ServiceAccounts\" :null,\" Privileged\" :false,\" Configuration\" :null,\" Properties\" :null,\" EnvironmentVariables\" :null,\" Dependencies\" :[{\" type\" :\" dogu\" ,\" name\" :\" cas\" ,\" version\" :\" \" }],\" OptionalDependencies\" :null},{\" Name\" :\" scm\" ,\" Version\" :\" 2.625.2\" ,\" PublishedAt\" :\" 0001-01-01T00:00:00Z\" ,\" DisplayName\" :\" Scm Manager\" ,\" Description\" :\" \" ,\" Category\" :\" \" ,\" Tags\" :null,\" Logo\" :\" \" ,\" URL\" :\" \" ,\" Image\" :\" \" ,\" ExposedPorts\" :null,\" ExposedCommands\" :null,\" Volumes\" :null,\" HealthCheck\" :{\" Type\" :\" \" ,\" State\" :\" \" ,\" Port\" :0,\" Path\" :\" \" ,\" Parameters\" :null},\" HealthChecks\" :null,\" ServiceAccounts\" :null,\" Privileged\" :false,\" Configuration\" :null,\" Properties\" :null,\" EnvironmentVariables\" :null,\" Dependencies\" :[{\" type\" :\" dogu\" ,\" name\" :\" cas\" ,\" version\" :\" \" }],\" OptionalDependencies\" :null}]"
685
+ expectedRepresentationV2 := "[{\" Name\" :\" jenkins\" ,\" Version\" :\" 1.625.2\" ,\" PublishedAt\" :\" 0001-01-01T00:00:00Z\" ,\" DisplayName\" :\" Jenkins CI\" ,\" Description\" :\" \" ,\" Category\" :\" \" ,\" Tags\" :null,\" Logo\" :\" \" ,\" URL\" :\" \" ,\" Image\" :\" \" ,\" ExposedPorts\" :null,\" ExposedCommands\" :null,\" Volumes\" :null,\" HealthCheck\" :{\" Type\" :\" \" ,\" State\" :\" \" ,\" Port\" :0,\" Path\" :\" \" ,\" Parameters\" :null},\" HealthChecks\" :null,\" ServiceAccounts\" :null,\" Privileged\" :false,\" Security\" :{\" Capabilities\" :{},\" RunAsNonRoot\" :false,\" ReadOnlyRootFileSystem\" :false},\" Configuration\" :null,\" Properties\" :null,\" EnvironmentVariables\" :null,\" Dependencies\" :[{\" type\" :\" dogu\" ,\" name\" :\" cas\" ,\" version\" :\" \" }],\" OptionalDependencies\" :null},{\" Name\" :\" scm\" ,\" Version\" :\" 2.625.2\" ,\" PublishedAt\" :\" 0001-01-01T00:00:00Z\" ,\" DisplayName\" :\" Scm Manager\" ,\" Description\" :\" \" ,\" Category\" :\" \" ,\" Tags\" :null,\" Logo\" :\" \" ,\" URL\" :\" \" ,\" Image\" :\" \" ,\" ExposedPorts\" :null,\" ExposedCommands\" :null,\" Volumes\" :null,\" HealthCheck\" :{\" Type\" :\" \" ,\" State\" :\" \" ,\" Port\" :0,\" Path\" :\" \" ,\" Parameters\" :null},\" HealthChecks\" :null,\" ServiceAccounts\" :null,\" Privileged\" :false,\" Security\" :{\" Capabilities\" :{},\" RunAsNonRoot\" :false,\" ReadOnlyRootFileSystem\" :false},\" Configuration\" :null,\" Properties\" :null,\" EnvironmentVariables\" :null,\" Dependencies\" :[{\" type\" :\" dogu\" ,\" name\" :\" cas\" ,\" version\" :\" \" }],\" OptionalDependencies\" :null}]"
686
686
687
687
t .Run ("Convert given dogu object into the string representation" , func (t * testing.T ) {
688
688
tests := []formatTest {
@@ -713,3 +713,11 @@ func Test_DoguFormatProvider_WriteDogusToString(t *testing.T) {
713
713
}
714
714
})
715
715
}
716
+
717
+ func TestUnmarshalProperties (t * testing.T ) {
718
+ dogu := & Dogu {}
719
+ dogu , _ , err := ReadDoguFromFile ("../resources/test/unmarshalProperties.json" )
720
+ require .Nil (t , err )
721
+ assert .Equal (t , "http://test.test" , dogu .Properties ["logoutUrl" ])
722
+ assert .Equal (t , "25" , dogu .Properties ["TestPort" ])
723
+ }
0 commit comments