@@ -646,7 +646,7 @@ func Test_DoguFormatProvider_WriteDoguToString(t *testing.T) {
646646 }
647647 dogu := Dogu {Name : "jenkins" , Version : "1.625.2" , DisplayName : "Jenkins CI" , Dependencies : expectedDependencies }
648648 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}"
650650
651651 t .Run ("Convert given dogu object into the string representation" , func (t * testing.T ) {
652652 tests := []formatTest {
@@ -682,7 +682,7 @@ func Test_DoguFormatProvider_WriteDogusToString(t *testing.T) {
682682 dogu2 := Dogu {Name : "scm" , Version : "2.625.2" , DisplayName : "Scm Manager" , Dependencies : expectedDependencies }
683683 dogus := []* Dogu {& dogu1 , & dogu2 }
684684 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}]"
686686
687687 t .Run ("Convert given dogu object into the string representation" , func (t * testing.T ) {
688688 tests := []formatTest {
@@ -713,3 +713,11 @@ func Test_DoguFormatProvider_WriteDogusToString(t *testing.T) {
713713 }
714714 })
715715}
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