}) Context("when the server does not have ssl enabled", func() { BeforeEach(func() { controller.SSLDisabled = true }) It("does not set keys", func() { Expect(controller.ConfigureServer()).To(Succeed()) Expect(agentClient.SetKeysCall.Receives.Keys).To(BeNil()) }) }) Context("when ssl is enabled but no keys are provided", func() { BeforeEach(func() { controller.EncryptKeys = []string{} }) It("returns an error", func() { Expect(controller.ConfigureServer()).To(MatchError("encrypt keys cannot be empty if ssl is enabled")) Expect(agentClient.SetKeysCall.Receives.Keys).To(BeNil()) }) }) }) Context("when it is the last node in the cluster", func() { BeforeEach(func() { agentClient.IsLastNodeCall.Returns.IsLastNode = true }) It("checks that it is synced", func() {