(t *testing.T)
| 515 | } |
| 516 | |
| 517 | func TestPublishErrorAfterInvalidPublishMessage(t *testing.T) { |
| 518 | ts := RunServerOnPort(ENC_TEST_PORT) |
| 519 | defer ts.Shutdown() |
| 520 | opts := options |
| 521 | nc, _ := opts.Connect() |
| 522 | defer nc.Close() |
| 523 | c, _ := nats.NewEncodedConn(nc, protobuf.PROTOBUF_ENCODER) |
| 524 | const testSubj = "test" |
| 525 | |
| 526 | c.Publish(testSubj, &testdata.Person{Name: "Anatolii"}) |
| 527 | |
| 528 | // Publish invalid protobuf message to catch decode error |
| 529 | c.Publish(testSubj, "foo") |
| 530 | |
| 531 | // Next publish with valid protobuf message should be successful |
| 532 | if err := c.Publish(testSubj, &testdata.Person{Name: "Anatolii"}); err != nil { |
| 533 | t.Error("Fail to send correct protobuf message after invalid message publishing", err) |
| 534 | } |
| 535 | } |
| 536 | |
| 537 | func TestVariousFailureConditions(t *testing.T) { |
| 538 | ts := RunServerOnPort(ENC_TEST_PORT) |
nothing calls this directly
no test coverage detected