(t *testing.T)
| 178 | } |
| 179 | |
| 180 | func TestCacheContent_JSONParsing(t *testing.T) { |
| 181 | jsonStr := `{"ip":"10.0.0.1","port":"22","user":"root","password":"pass","alias":"test"}` |
| 182 | |
| 183 | // Test the struct definition via the exported ExecuteCreate |
| 184 | cfg, _ := setupCreateConfig(t) |
| 185 | ctrl := NewCreateController(TypeCaches, jsonStr, cfg) |
| 186 | ctrl.ExecuteCreate() |
| 187 | |
| 188 | found := false |
| 189 | for _, s := range cfg.ServerLists { |
| 190 | if s.IP == "10.0.0.1" && s.Alias == "test" { |
| 191 | found = true |
| 192 | } |
| 193 | } |
| 194 | assert.True(t, found) |
| 195 | } |
nothing calls this directly
no test coverage detected