Beispiel #1
0
 @Test
 public void testAddProvider() {
   Service service = new Service(logger, "service1");
   logger.reset();
   service.addProvider("provider1");
   Assert.assertEquals(1, logger.records().size());
   Assert.assertEquals("Adding provider1 to service1\n", logger.getFileContent());
 }
Beispiel #2
0
 @Test
 public void testRemoveExistingProvider() {
   Service service = new Service(logger, "service1");
   service.addProvider("provider1");
   logger.reset();
   Assert.assertTrue(service.removeProvider("provider1"));
   Assert.assertEquals(1, logger.records().size());
   Assert.assertEquals("Removing provider1 from service1\n", logger.getFileContent());
 }
Beispiel #3
0
 @Test
 public void testConstructorLogs() {
   new Service(logger, "service1");
   Assert.assertEquals(1, logger.records().size());
   Assert.assertEquals("Creating service1\n", logger.getFileContent());
 }